Skip to content

Commit bcf54ce

Browse files
Nan WuAndroid Build Coastguard Worker
authored andcommitted
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:1896c2e7068c9ec1ab8355d863d7e8107d5d5706) Merged-In: I8f25d7a5e47890a0496af023149717e1df482f98 Change-Id: I8f25d7a5e47890a0496af023149717e1df482f98
1 parent e7c54eb commit bcf54ce

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

core/java/android/app/Notification.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,8 +3413,11 @@ public void setLatestEventInfo(Context context,
34133413
*
34143414
* @hide
34153415
*/
3416-
public void setAllowlistToken(@Nullable IBinder token) {
3417-
mAllowlistToken = token;
3416+
public void clearAllowlistToken() {
3417+
mAllowlistToken = null;
3418+
if (publicVersion != null) {
3419+
publicVersion.clearAllowlistToken();
3420+
}
34183421
}
34193422

34203423
/**

services/core/java/com/android/server/notification/NotificationManagerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4368,7 +4368,7 @@ private StatusBarNotification sanitizeSbn(String pkg, int userId,
43684368
// Remove background token before returning notification to untrusted app, this
43694369
// ensures the app isn't able to perform background operations that are
43704370
// associated with notification interactions.
4371-
notification.setAllowlistToken(null);
4371+
notification.clearAllowlistToken();
43724372
return new StatusBarNotification(
43734373
sbn.getPackageName(),
43744374
sbn.getOpPkg(),

0 commit comments

Comments
 (0)