summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNan Wu <wnan@google.com>2023-06-16 14:42:24 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-09-11 18:20:08 +0000
commit005fa31aae197fd368ad6dc67e454f56a2097121 (patch)
tree518d7da6927ba3930980a9f05837736483d7d6c3
parentd5d0f3222d4bb6827f96455af85cb74d95ac9b57 (diff)
DO NOT MERGE Fix BAL via notification.publicVersion
We stripped the token that allows app to retrieve their own notification and fire their own PI to launch activities from background. But we forgot to strip the token from notification.publicVersion Bug: 278558814 Test: NotificationManagerTest#testActivityStartFromRetrievedNotification_isBlocked (cherry picked from commit cf851d81a954f0a6dd0c2fd7defa93932539e7f9) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:8d839e4985d0acc662e1019390c88fab20bacbd6) Merged-In: I8f25d7a5e47890a0496af023149717e1df482f98 Change-Id: I8f25d7a5e47890a0496af023149717e1df482f98
-rw-r--r--core/java/android/app/Notification.java7
-rwxr-xr-xservices/core/java/com/android/server/notification/NotificationManagerService.java2
2 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 15a0fb81c138..9004c3a3005a 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -3366,8 +3366,11 @@ public class Notification implements Parcelable
*
* @hide
*/
- public void setAllowlistToken(@Nullable IBinder token) {
- mAllowlistToken = token;
+ public void clearAllowlistToken() {
+ mAllowlistToken = null;
+ if (publicVersion != null) {
+ publicVersion.clearAllowlistToken();
+ }
}
/**
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 0e537cc1af31..5d22b4932d2d 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -4202,7 +4202,7 @@ public class NotificationManagerService extends SystemService {
// Remove background token before returning notification to untrusted app, this
// ensures the app isn't able to perform background operations that are
// associated with notification interactions.
- notification.setAllowlistToken(null);
+ notification.clearAllowlistToken();
return new StatusBarNotification(
sbn.getPackageName(),
sbn.getOpPkg(),