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

Commit 856be9e9 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Add PendingIntent flags

Test: atest
Fixes: 174965424
Fixes: 175014468
Fixes: 175005650
Fixes: 174969959
Fixes: 174970399
Fixes: 174935104
Fixes: 174935955
Fixes: 174965245
Fixes: 174258141
Fixes: 174161800
Fixes: 173741872
Change-Id: I0d3b67d681f49c0c8f96fd9265100b6ca6671a2d
parent 03f23572
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -629,10 +629,8 @@ public class NotificationEntryManagerTest extends SysuiTestCase {
        return new Notification.Action.Builder(
                Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
                "action",
                // TODO(b/174935104) Please replace FLAG_MUTABLE_UNAUDITED below
                // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
                PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
                    PendingIntent.FLAG_MUTABLE_UNAUDITED)).build();
                    PendingIntent.FLAG_IMMUTABLE)).build();
    }

    private static class FakeNotificationLifetimeExtender implements NotificationLifetimeExtender {
+2 −6
Original line number Diff line number Diff line
@@ -233,10 +233,8 @@ public class NotificationEntryTest extends SysuiTestCase {
        return new Notification.Action.Builder(
                Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
                title,
                // TODO(b/174965424) Please replace FLAG_MUTABLE_UNAUDITED below
                // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
                PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
                    PendingIntent.FLAG_MUTABLE_UNAUDITED))
                    PendingIntent.FLAG_IMMUTABLE))
                .setContextual(true)
                .build();
    }
@@ -245,10 +243,8 @@ public class NotificationEntryTest extends SysuiTestCase {
        return new Notification.Action.Builder(
                Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
                title,
                // TODO(b/174965424) Please replace FLAG_MUTABLE_UNAUDITED below
                // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
                PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
                    PendingIntent.FLAG_MUTABLE_UNAUDITED)).build();
                    PendingIntent.FLAG_IMMUTABLE)).build();
    }

    private ArrayList<Notification.Action> createActions(String... titles) {
+1 −3
Original line number Diff line number Diff line
@@ -476,10 +476,8 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {

    private NotificationEntry createBubble() {
        Notification.BubbleMetadata data = new Notification.BubbleMetadata.Builder(
                // TODO(b/174970399) Please replace FLAG_MUTABLE_UNAUDITED below
                // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
                PendingIntent.getActivity(mContext, 0, new Intent(),
                    PendingIntent.FLAG_MUTABLE_UNAUDITED),
                    PendingIntent.FLAG_MUTABLE),
                        Icon.createWithResource(mContext.getResources(), R.drawable.android))
                .build();
        Notification n = new Notification.Builder(getContext(), "a")
+1 −3
Original line number Diff line number Diff line
@@ -213,11 +213,9 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
                notification, UserHandle.CURRENT, null, 0);
        mEntry = new NotificationEntryBuilder().setSbn(mSbn).setShortcutInfo(mShortcutInfo).build();

        // TODO(b/175005650) Please replace FLAG_MUTABLE_UNAUDITED below
        // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
        PendingIntent bubbleIntent = PendingIntent.getActivity(mContext, 0,
                new Intent(mContext, BubblesTestActivity.class),
                PendingIntent.FLAG_MUTABLE_UNAUDITED);
                PendingIntent.FLAG_MUTABLE);
        mBubbleSbn = new SbnBuilder(mSbn).setBubbleMetadata(
                new Notification.BubbleMetadata.Builder(bubbleIntent,
                        Icon.createWithResource(mContext, R.drawable.android)).build())
+1 −3
Original line number Diff line number Diff line
@@ -455,10 +455,8 @@ public class NotificationTestHelper {

    private BubbleMetadata makeBubbleMetadata(PendingIntent deleteIntent) {
        Intent target = new Intent(mContext, BubblesTestActivity.class);
        // TODO(b/175014468) Please replace FLAG_MUTABLE_UNAUDITED below
        // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
        PendingIntent bubbleIntent = PendingIntent.getActivity(mContext, 0, target,
                PendingIntent.FLAG_MUTABLE_UNAUDITED);
                PendingIntent.FLAG_MUTABLE);

        return new BubbleMetadata.Builder(bubbleIntent,
                        Icon.createWithResource(mContext, R.drawable.android))
Loading