commit | 7ac1135a7f857d40e125ba591a0ef005d5e00969 | [log] [tgz] |
---|---|---|
author | Nan Wu <wnan@google.com> | Fri Jun 16 14:42:24 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Sep 07 21:55:36 2023 +0000 |
tree | e4aedc8690af7e7e1f3c6a68647b68fbb3d0df62 | |
parent | d8d48d8689f8f7bace3f8ddd0f96dbaac8b2712b [diff] |
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 https://googleplex-android-review.googlesource.com/q/commit:e79cbff7f85ea5497dcdb27b13535e4e3ac9913f) Merged-In: I8f25d7a5e47890a0496af023149717e1df482f98 Change-Id: I8f25d7a5e47890a0496af023149717e1df482f98
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 11dd30b..54c8cb0 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java
@@ -3485,8 +3485,11 @@ * * @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 79559fd..647087d 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -4444,7 +4444,7 @@ // 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(),