Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 19d66c20 authored by Nan Wu's avatar Nan Wu Committed by Kevin F. Haggerty
Browse files

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 cf851d81)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:8d839e4985d0acc662e1019390c88fab20bacbd6)
Merged-In: I8f25d7a5e47890a0496af023149717e1df482f98
Change-Id: I8f25d7a5e47890a0496af023149717e1df482f98
parent 74dcc7f8
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3357,8 +3357,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();
        }
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -4240,7 +4240,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(),