Fixed start on boot

This commit is contained in:
Ryemantis
2021-08-27 04:22:06 -07:00
parent f69f748064
commit 008e9b7961

View File

@ -27,7 +27,11 @@ public class OnBootReceiver extends BroadcastReceiver implements I2PConstants {
Intent routerService = new Intent(context, RouterService.class);
// Ticket #2404
try {
context.startService(routerService);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O){
context.startForegroundService(routerService);
} else {
context.startService(routerService);
}
} catch (IllegalStateException ex) {
Util.e("Error: ", ex);
}