From 89f97f57cb0f39c1852a975f0b8080216e990700 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Tue, 9 Oct 2018 18:45:44 -0700 Subject: [PATCH] Update our boot receiver to schedule a message pull. Previously we were starting a background service, which isn't allowed for targetSdk 26. This will do the same thing but at a time decided by the system. --- src/org/thoughtcrime/securesms/service/BootReceiver.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/org/thoughtcrime/securesms/service/BootReceiver.java b/src/org/thoughtcrime/securesms/service/BootReceiver.java index 5dba90df38..e94765b44c 100644 --- a/src/org/thoughtcrime/securesms/service/BootReceiver.java +++ b/src/org/thoughtcrime/securesms/service/BootReceiver.java @@ -5,14 +5,13 @@ import android.content.Context; import android.content.Intent; import android.os.Build; +import org.thoughtcrime.securesms.ApplicationContext; +import org.thoughtcrime.securesms.jobs.PushNotificationReceiveJob; + public class BootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - if (intent != null && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { - Intent messageRetrievalService = new Intent(context, MessageRetrievalService.class); - context.startService(messageRetrievalService); - } + ApplicationContext.getInstance(context).getJobManager().add(new PushNotificationReceiveJob(context)); } - }