mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 23:43:38 +00:00
Fix service calls that won't foreground
This commit is contained in:
parent
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user