From d822bfa180a236aa89294f94ed3bc1d9eb96d73a Mon Sep 17 00:00:00 2001 From: Ashwini Oruganti Date: Sun, 6 Dec 2020 22:46:57 -0800 Subject: [PATCH] SnoozeHelper: 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: I40f3f238c3f475c88586381c56e932a3f8f66a8c --- .../java/com/android/server/notification/SnoozeHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/notification/SnoozeHelper.java b/services/core/java/com/android/server/notification/SnoozeHelper.java index 2122b9c198057..3e197fb783467 100644 --- a/services/core/java/com/android/server/notification/SnoozeHelper.java +++ b/services/core/java/com/android/server/notification/SnoozeHelper.java @@ -462,6 +462,8 @@ public class SnoozeHelper { } private PendingIntent createPendingIntent(String pkg, String key, int userId) { + // TODO(b/174969959) Please replace FLAG_MUTABLE_UNAUDITED below + // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE. return PendingIntent.getBroadcast(mContext, REQUEST_CODE_REPOST, new Intent(REPOST_ACTION) @@ -469,7 +471,7 @@ public class SnoozeHelper { .addFlags(Intent.FLAG_RECEIVER_FOREGROUND) .putExtra(EXTRA_KEY, key) .putExtra(EXTRA_USER_ID, userId), - PendingIntent.FLAG_UPDATE_CURRENT); + PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED); } public void scheduleRepostsForPersistedNotifications(long currentTime) {