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

Commit c5919d0a authored by Ashwini Oruganti's avatar Ashwini Oruganti
Browse files

InflatedSmartRepliesTest: Mark PendingIntents with FLAG_MUTABLE

Added FLAG_MUTABLE as these are direct reply related
See go/immutable-pendingintents for more context.

Bug: 160794467
Test: TH
Change-Id: Ic3e9c567f27788424b71030b742cca45776d47ab
parent c70f1a8a
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -425,7 +425,8 @@ public class InflatedSmartRepliesTest extends SysuiTestCase {
    private void setupAppGeneratedReplies(
    private void setupAppGeneratedReplies(
            CharSequence[] smartReplies, boolean allowSystemGeneratedReplies) {
            CharSequence[] smartReplies, boolean allowSystemGeneratedReplies) {
        PendingIntent pendingIntent =
        PendingIntent pendingIntent =
                PendingIntent.getBroadcast(mContext, 0, TEST_INTENT, 0);
                PendingIntent.getBroadcast(mContext, 0, TEST_INTENT,
                        PendingIntent.FLAG_MUTABLE);
        Notification.Action action =
        Notification.Action action =
                new Notification.Action.Builder(null, "Test Action", pendingIntent).build();
                new Notification.Action.Builder(null, "Test Action", pendingIntent).build();
        when(mRemoteInput.getChoices()).thenReturn(smartReplies);
        when(mRemoteInput.getChoices()).thenReturn(smartReplies);
@@ -456,7 +457,8 @@ public class InflatedSmartRepliesTest extends SysuiTestCase {
    }
    }


    private Notification.Action.Builder createActionBuilder(String actionTitle, Intent intent) {
    private Notification.Action.Builder createActionBuilder(String actionTitle, Intent intent) {
        PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent,
                PendingIntent.FLAG_MUTABLE);
        return new Notification.Action.Builder(mActionIcon, actionTitle, pendingIntent);
        return new Notification.Action.Builder(mActionIcon, actionTitle, pendingIntent);
    }
    }