From 6dcec7c2c5a2ab142516f7e8060b70bfc7381f16 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Wed, 20 Dec 2017 11:27:57 -0800 Subject: [PATCH] Fix service calls that won't foreground --- src/org/thoughtcrime/securesms/service/BootReceiver.java | 4 +--- .../securesms/service/PanicResponderListener.java | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/org/thoughtcrime/securesms/service/BootReceiver.java b/src/org/thoughtcrime/securesms/service/BootReceiver.java index 42f0fec894..5dba90df38 100644 --- a/src/org/thoughtcrime/securesms/service/BootReceiver.java +++ b/src/org/thoughtcrime/securesms/service/BootReceiver.java @@ -11,9 +11,7 @@ public class BootReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { if (intent != null && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { Intent messageRetrievalService = new Intent(context, MessageRetrievalService.class); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(messageRetrievalService); - else context.startService(messageRetrievalService); + context.startService(messageRetrievalService); } } diff --git a/src/org/thoughtcrime/securesms/service/PanicResponderListener.java b/src/org/thoughtcrime/securesms/service/PanicResponderListener.java index ddbc244522..c6cefc6591 100644 --- a/src/org/thoughtcrime/securesms/service/PanicResponderListener.java +++ b/src/org/thoughtcrime/securesms/service/PanicResponderListener.java @@ -23,9 +23,7 @@ public class PanicResponderListener extends BroadcastReceiver { { Intent lockIntent = new Intent(context, KeyCachingService.class); lockIntent.setAction(KeyCachingService.CLEAR_KEY_ACTION); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(lockIntent); - else context.startService(lockIntent); + context.startService(lockIntent); } } } \ No newline at end of file