diff --git a/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java b/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java index 341559663..bf8b6218c 100644 --- a/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java +++ b/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java @@ -108,4 +108,15 @@ public final class FetchForegroundService extends Service { public IBinder onBind(Intent intent) { return null; } + + @Override + public void onTimeout(int startId, int fgsType) { + if (fetchingSynchronously) { + fetchingSynchronously = false; + synchronized (STOP_NOTIFIER) { + STOP_NOTIFIER.notifyAll(); + } + } + } + }