kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix service calls that won't foreground
rodzic
512dc19471
commit
6dcec7c2c5
|
@ -11,9 +11,7 @@ public class BootReceiver extends BroadcastReceiver {
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent != null && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
if (intent != null && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
||||||
Intent messageRetrievalService = new Intent(context, MessageRetrievalService.class);
|
Intent messageRetrievalService = new Intent(context, MessageRetrievalService.class);
|
||||||
|
context.startService(messageRetrievalService);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(messageRetrievalService);
|
|
||||||
else context.startService(messageRetrievalService);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,7 @@ public class PanicResponderListener extends BroadcastReceiver {
|
||||||
{
|
{
|
||||||
Intent lockIntent = new Intent(context, KeyCachingService.class);
|
Intent lockIntent = new Intent(context, KeyCachingService.class);
|
||||||
lockIntent.setAction(KeyCachingService.CLEAR_KEY_ACTION);
|
lockIntent.setAction(KeyCachingService.CLEAR_KEY_ACTION);
|
||||||
|
context.startService(lockIntent);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(lockIntent);
|
|
||||||
else context.startService(lockIntent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Ładowanie…
Reference in New Issue