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

25 lines
790 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 androidx.legacy.content.WakefulBroadcastReceiver;
2016-06-07 21:48:17 +02:00
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
public class DataReceiver extends WakefulBroadcastReceiver {
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))
log.debug("onReceive " + intent);
startWakefulService(context, new Intent(context, DataService.class)
.setAction(intent.getAction())
.putExtras(intent));
2016-06-07 21:48:17 +02:00
}
}