AndroidAPS/app/src/main/java/info/nightscout/androidaps/receivers/DataReceiver.java

26 lines
838 B
Java
Raw Normal View History

2016-06-07 21:48:17 +02:00
package info.nightscout.androidaps.receivers;
import android.content.Context;
import android.content.Intent;
import android.support.v4.content.WakefulBroadcastReceiver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
2018-07-29 00:20:41 +02:00
import info.nightscout.androidaps.Constants;
2018-07-29 00:00:48 +02:00
import info.nightscout.androidaps.services.DataService;
import info.nightscout.androidaps.Config;
2016-06-07 21:48:17 +02:00
public class DataReceiver extends WakefulBroadcastReceiver {
2018-07-29 00:20:41 +02:00
private static Logger log = LoggerFactory.getLogger(Constants.DATASERVICE);
2016-06-07 21:48:17 +02:00
@Override
public void onReceive(Context context, Intent intent) {
2018-07-29 00:20:41 +02:00
if (Config.logDataService)
log.debug("onReceive " + intent);
startWakefulService(context, new Intent(context, DataService.class)
.setAction(intent.getAction())
.putExtras(intent));
2016-06-07 21:48:17 +02:00
}
}