From 8afc387eb1fe5061250e88d5666ae47c11ab5b07 Mon Sep 17 00:00:00 2001 From: John Wu Date: Tue, 27 Sep 2022 17:11:32 +0000 Subject: [PATCH] Use setIdentifier instead of dynamic categories Change I27987301ebf393de6f781b17ed7bc789789c01ab introduced the usage of dynamic categories to prevent the pending intent from being cached. This is incompatible with the new T explicit intent filter enforcement, as a dynamic category can never match any intent-filter. Switch to use the PendingIntent#setIdentifier API introduced in API 29, specifically designed for this use case. Bug: 249043995 Test: m + manual Change-Id: I2bbe4e554ef337299138f2a7691eeffc60e18e9d --- .../systemui/statusbar/notification/InstantAppNotifier.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/InstantAppNotifier.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/InstantAppNotifier.java index 822840dfd86b9..0a5e9867a17fe 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/InstantAppNotifier.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/InstantAppNotifier.java @@ -290,7 +290,7 @@ public class InstantAppNotifier .setComponent(aiaComponent) .setAction(Intent.ACTION_VIEW) .addCategory(Intent.CATEGORY_BROWSABLE) - .addCategory("unique:" + System.currentTimeMillis()) + .setIdentifier("unique:" + System.currentTimeMillis()) .putExtra(Intent.EXTRA_PACKAGE_NAME, appInfo.packageName) .putExtra( Intent.EXTRA_VERSION_CODE,