From e26a2fb31335ab850cb6b8e5fdcf983240ee04d1 Mon Sep 17 00:00:00 2001 From: Ashwini Oruganti Date: Sun, 6 Dec 2020 20:42:00 -0800 Subject: [PATCH] NotificationEntryTest: 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: I7325954fb3396af0d2aa8ee021d9ab6e95f18afa --- .../notification/collection/NotificationEntryTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java index 1a022ec7c87da..01b3d8e787e69 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java @@ -233,7 +233,10 @@ public class NotificationEntryTest extends SysuiTestCase { return new Notification.Action.Builder( Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon), title, - PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"), 0)) + // 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)) .setContextual(true) .build(); } @@ -242,7 +245,10 @@ public class NotificationEntryTest extends SysuiTestCase { return new Notification.Action.Builder( Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon), title, - PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"), 0)).build(); + // 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(); } private ArrayList createActions(String... titles) {