소스 검색

Merge pull request #8365 from af7567/notifications

Use unique requestcode for notification PendingIntents
Tobias Kaminsky 3 년 전
부모
커밋
eceb3a13d4

+ 2 - 1
src/main/java/com/nextcloud/client/integrations/deck/DeckApiImpl.java

@@ -76,7 +76,8 @@ public class DeckApiImpl implements DeckApi {
 
     private PendingIntent createPendingIntent(@NonNull Intent intent, @NonNull Notification notification, @NonNull User user) {
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-        return PendingIntent.getActivity(context, 0, putExtrasToIntent(intent, notification, user),
+        return PendingIntent.getActivity(context, notification.getNotificationId(),
+                                         putExtrasToIntent(intent, notification, user),
                                          PendingIntent.FLAG_ONE_SHOT);
     }
 

+ 2 - 1
src/main/java/com/nextcloud/client/jobs/NotificationWork.kt

@@ -156,7 +156,8 @@ class NotificationWork constructor(
             }
             intent.putExtra(KEY_NOTIFICATION_ACCOUNT, user.accountName)
             intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
-            pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT)
+            pendingIntent = PendingIntent.getActivity(context, notification.getNotificationId(), intent,
+                PendingIntent.FLAG_ONE_SHOT)
         }
 
         val pushNotificationId = randomId.nextInt()