2016-06-07 21:48:17 +02:00
|
|
|
package info.nightscout.androidaps.receivers;
|
|
|
|
|
2019-08-09 14:17:17 +02:00
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
import android.content.ComponentName;
|
2016-06-07 21:48:17 +02:00
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
2018-07-29 14:39:56 +02:00
|
|
|
import info.nightscout.androidaps.logging.L;
|
2018-07-29 00:00:48 +02:00
|
|
|
import info.nightscout.androidaps.services.DataService;
|
2016-06-07 21:48:17 +02:00
|
|
|
|
2019-08-09 14:17:17 +02:00
|
|
|
public class DataReceiver extends BroadcastReceiver {
|
2018-07-29 14:39:56 +02:00
|
|
|
private static Logger log = LoggerFactory.getLogger(L.DATASERVICE);
|
2016-06-07 21:48:17 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
2018-07-29 14:39:56 +02:00
|
|
|
if (L.isEnabled(L.DATASERVICE))
|
2016-06-21 23:24:54 +02:00
|
|
|
log.debug("onReceive " + intent);
|
2019-08-09 14:17:17 +02:00
|
|
|
// Explicitly specify that GcmIntentService will handle the intent.
|
|
|
|
ComponentName comp = new ComponentName(context.getPackageName(),
|
|
|
|
DataService.class.getName());
|
|
|
|
DataService.enqueueWork(context, intent.setComponent(comp));
|
2016-06-07 21:48:17 +02:00
|
|
|
}
|
|
|
|
}
|