From 9bd59dc8e621a3a420b1206cd96641c93dac9531 Mon Sep 17 00:00:00 2001 From: Ashwini Oruganti Date: Sun, 6 Dec 2020 00:15:57 -0800 Subject: [PATCH] NotificationListenerServiceTest: Mark unaudited PendingIntents with FLAG_MUTABLE_UNAUDITED These PIs need an explicit mutability flag. This temporay flag is being used to mark these points in code and should be replaced ASAP. See go/immutable-pendingintents for more context. Bug: 160794467 Test: TH Exempt-From-Owner-Approval: noop change Change-Id: I69f27c2daf8ece7331c47ce255368e6222143bf1 --- .../server/notification/NotificationListenerServiceTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java index fdc089ee2f7eb..9e0a05ecc8f41 100644 --- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java @@ -357,11 +357,13 @@ public class NotificationListenerServiceTest extends UiServiceTestCase { private ArrayList getSmartActions(String key, int index) { ArrayList actions = new ArrayList<>(); for (int i = 0; i < index; i++) { + // TODO(b/174935955) Please replace FLAG_MUTABLE_UNAUDITED below + // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. PendingIntent intent = PendingIntent.getBroadcast( getContext(), index /*requestCode*/, new Intent("ACTION_" + key), - 0 /*flags*/); + PendingIntent.FLAG_MUTABLE_UNAUDITED /*flags*/); actions.add(new Notification.Action.Builder(null /*icon*/, key, intent).build()); } return actions;