Skip to content

Commit 6cfe6b9

Browse files
committed
[FreezeUnfreeze] Fix "Tap to freeze" notifications not working if issued for multiple apps
Signed-off-by: Muntashir Al-Islam <muntashirakon@riseup.net>
1 parent 7fb0a45 commit 6cfe6b9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/src/main/java/io/github/muntashirakon/AppManager/apk/behavior/FreezeUnfreeze.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,13 @@ static void launchApp(@NonNull FragmentActivity activity, @NonNull FreezeUnfreez
135135
activity.startActivity(launchIntent);
136136
Intent intent = getShortcutIntent(activity, shortcutInfo);
137137
intent.putExtra(EXTRA_FORCE_FREEZE, true);
138-
PendingIntent pendingIntent = PendingIntentCompat.getActivity(activity, 0, intent,
139-
PendingIntent.FLAG_ONE_SHOT, false);
138+
int requestCode = shortcutInfo.hashCode();
139+
PendingIntent pendingIntent = PendingIntentCompat.getActivity(activity, requestCode,
140+
intent, PendingIntent.FLAG_ONE_SHOT, false);
140141
// There's a small chance that the notification by shortcutInfo.hasCode() already exists, in that case,
141142
// find the next one. This will cause trouble with dismissing the notification, but this is a viable
142143
// trade-off.
143-
String notificationTag = String.valueOf(shortcutInfo.hashCode());
144+
String notificationTag = String.valueOf(requestCode);
144145
NotificationUtils.displayFreezeUnfreezeNotification(activity, notificationTag, builder -> builder
145146
.setDefaults(Notification.DEFAULT_ALL)
146147
.setWhen(System.currentTimeMillis())

0 commit comments

Comments
 (0)