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;
|
2016-06-07 23:36:22 +02:00
|
|
|
import info.nightscout.androidaps.Config;
|
2016-06-07 21:48:17 +02:00
|
|
|
|
2016-07-18 20:19:55 +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)
|
2016-06-21 23:24:54 +02:00
|
|
|
log.debug("onReceive " + intent);
|
|
|
|
startWakefulService(context, new Intent(context, DataService.class)
|
|
|
|
.setAction(intent.getAction())
|
|
|
|
.putExtras(intent));
|
2016-06-07 21:48:17 +02:00
|
|
|
}
|
|
|
|
}
|