alert only when danar is selected
This commit is contained in:
parent
e37917dae4
commit
aa87cb7dea
1 changed files with 4 additions and 1 deletions
|
@ -16,6 +16,8 @@ import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import info.nightscout.androidaps.Config;
|
import info.nightscout.androidaps.Config;
|
||||||
import info.nightscout.androidaps.Constants;
|
import info.nightscout.androidaps.Constants;
|
||||||
|
import info.nightscout.androidaps.MainActivity;
|
||||||
|
import info.nightscout.androidaps.plugins.DanaR.DanaRFragment;
|
||||||
import info.nightscout.androidaps.plugins.DanaR.Services.DanaRService;
|
import info.nightscout.androidaps.plugins.DanaR.Services.DanaRService;
|
||||||
|
|
||||||
public class KeepAliveReceiver extends BroadcastReceiver {
|
public class KeepAliveReceiver extends BroadcastReceiver {
|
||||||
|
@ -28,7 +30,8 @@ public class KeepAliveReceiver extends BroadcastReceiver {
|
||||||
wl.acquire();
|
wl.acquire();
|
||||||
|
|
||||||
log.debug("KeepAlive received");
|
log.debug("KeepAlive received");
|
||||||
if (Config.DANAR) {
|
DanaRFragment danaRFragment = (DanaRFragment) MainActivity.getSpecificPlugin(DanaRFragment.class);
|
||||||
|
if (Config.DANAR && danaRFragment != null && danaRFragment.isEnabled()) {
|
||||||
Intent intent = new Intent(context, DanaRService.class);
|
Intent intent = new Intent(context, DanaRService.class);
|
||||||
context.startService(intent);
|
context.startService(intent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue