diff --git a/app/src/main/java/org/thoughtcrime/securesms/gcm/FcmJobService.java b/app/src/main/java/org/thoughtcrime/securesms/gcm/FcmJobService.java index 8e62df2a1c..7eee7e6b9f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/gcm/FcmJobService.java +++ b/app/src/main/java/org/thoughtcrime/securesms/gcm/FcmJobService.java @@ -11,8 +11,8 @@ import org.signal.core.util.concurrent.SignalExecutors; import org.signal.core.util.logging.Log; -import org.thoughtcrime.securesms.dependencies.AppDependencies; import org.thoughtcrime.securesms.messages.WebSocketDrainer; +import org.thoughtcrime.securesms.service.KeyCachingService; import org.thoughtcrime.securesms.util.AppForegroundObserver; import org.thoughtcrime.securesms.util.ServiceUtil; @@ -40,8 +40,8 @@ public static void schedule(@NonNull Context context) { public boolean onStartJob(JobParameters params) { Log.d(TAG, "onStartJob()"); - if (AppForegroundObserver.isForegrounded()) { - Log.i(TAG, "App is foregrounded. No need to run."); + if (KeyCachingService.isLocked() || AppForegroundObserver.isForegrounded()) { + Log.i(TAG, "App is locked or foregrounded. No need to run."); return false; }