run DummyService on start instead of NSClientService
This commit is contained in:
parent
d467d679df
commit
f26069db00
1 changed files with 6 additions and 2 deletions
|
@ -3,8 +3,9 @@ package info.nightscout.androidaps.plugins.general.nsclient.receivers;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.services.NSClientService;
|
import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService;
|
||||||
|
|
||||||
public class AutoStartReceiver extends BroadcastReceiver {
|
public class AutoStartReceiver extends BroadcastReceiver {
|
||||||
public AutoStartReceiver() {
|
public AutoStartReceiver() {
|
||||||
|
@ -12,6 +13,9 @@ public class AutoStartReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
context.startService(new Intent(context, NSClientService.class));
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||||
|
context.startForegroundService(new Intent(context, DummyService.class));
|
||||||
|
else
|
||||||
|
context.startService(new Intent(context, DummyService.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue