2016-06-07 21:48:17 +02:00
|
|
|
package info.nightscout.androidaps.receivers;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
2019-08-26 15:06:34 +02:00
|
|
|
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
|
|
|
|
2019-08-26 15:06:34 +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))
|
2016-06-21 23:24:54 +02:00
|
|
|
log.debug("onReceive " + intent);
|
2019-08-26 15:06:34 +02:00
|
|
|
startWakefulService(context, new Intent(context, DataService.class)
|
|
|
|
.setAction(intent.getAction())
|
|
|
|
.putExtras(intent));
|
2016-06-07 21:48:17 +02:00
|
|
|
}
|
|
|
|
}
|