From 584801ee8c2853ebfe4942eb348aab3d88a1ca49 Mon Sep 17 00:00:00 2001 From: Ashwini Oruganti Date: Sat, 5 Dec 2020 21:59:10 -0800 Subject: [PATCH] NotificationIntrusivenessExtractorTest: 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: I617427beb57b10f5bee64ec82399cbacef7ea1ec --- .../NotificationIntrusivenessExtractorTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java index 00d93ded9a3cd..a9a3b2b0ed22d 100644 --- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java @@ -58,8 +58,11 @@ public class NotificationIntrusivenessExtractorTest extends UiServiceTestCase { NotificationChannel channel = new NotificationChannel("a", "a", IMPORTANCE_DEFAULT); final Notification.Builder builder = new Notification.Builder(getContext()) .setContentTitle("foo") + // TODO(b/174258141) Please replace FLAG_MUTABLE_UNAUDITED below + // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. .setFullScreenIntent(PendingIntent.getActivity( - getContext(), 0, new Intent(""), 0), true) + getContext(), 0, new Intent(""), PendingIntent.FLAG_MUTABLE_UNAUDITED), + true) .setSmallIcon(android.R.drawable.sym_def_app_icon); Notification n = builder.build(); @@ -76,8 +79,11 @@ public class NotificationIntrusivenessExtractorTest extends UiServiceTestCase { NotificationChannel channel = new NotificationChannel("a", "a", IMPORTANCE_DEFAULT); final Notification.Builder builder = new Notification.Builder(getContext()) .setContentTitle("foo") + // TODO(b/174258141) Please replace FLAG_MUTABLE_UNAUDITED below + // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. .setFullScreenIntent(PendingIntent.getActivity( - getContext(), 0, new Intent(""), 0), true) + getContext(), 0, new Intent(""), PendingIntent.FLAG_MUTABLE_UNAUDITED), + true) .setSmallIcon(android.R.drawable.sym_def_app_icon); Notification n = builder.build();