From 7150d328722c680535517d0bd37a6f6c23b080d6 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 20 Jun 2019 18:07:56 +0200 Subject: [PATCH] Use unique alarm intents --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 51ae850551..7213e5fb3d 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -60,6 +60,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.Random; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.RejectedExecutionException; @@ -1050,7 +1051,7 @@ public class ServiceSynchronize extends LifecycleService { } }; - String id = BuildConfig.APPLICATION_ID + ".POLL." + account.id; + String id = BuildConfig.APPLICATION_ID + ".POLL." + account.id + "." + new Random().nextInt(); PendingIntent pi = PendingIntent.getBroadcast(this, 0, new Intent(id), 0); registerReceiver(alarm, new IntentFilter(id)); @@ -1175,7 +1176,7 @@ public class ServiceSynchronize extends LifecycleService { } }; - String id = BuildConfig.APPLICATION_ID + ".BACKOFF." + account.id; + String id = BuildConfig.APPLICATION_ID + ".BACKOFF." + account.id + "." + new Random().nextInt(); PendingIntent pi = PendingIntent.getBroadcast(this, 0, new Intent(id), 0); registerReceiver(alarm, new IntentFilter(id));