From a335516ab23c7273f47ae32c7193877cf55939ef Mon Sep 17 00:00:00 2001 From: Gavin Corkery Date: Tue, 20 Oct 2020 10:00:11 +0100 Subject: [PATCH] Add immutability flag to PendingIntents Explicitly set FLAG_IMMUTABLE for all PendingIntents in BugreportProgressService. Test: Builds Bug: 170165227 Bug: 171830604 Bug: 178803845 Change-Id: Iae1489b9c8fa323448e60615e99ad96aee1cd1d7 Merged-in: Iae1489b9c8fa323448e60615e99ad96aee1cd1d7 (cherry picked from commit 2d38f6e4f04953a07f80984b50d3efefa64cb374) --- .../Shell/src/com/android/shell/BugreportProgressService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index f6c2ee264cb56..6b4c239f2b5a6 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -784,7 +784,7 @@ public class BugreportProgressService extends Service { intent.setClass(context, BugreportProgressService.class); intent.putExtra(EXTRA_ID, info.id); return PendingIntent.getService(context, info.id, intent, - PendingIntent.FLAG_UPDATE_CURRENT); + PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); } /** @@ -1244,7 +1244,7 @@ public class BugreportProgressService extends Service { .setTicker(title) .setContentText(content) .setContentIntent(PendingIntent.getService(mContext, info.id, shareIntent, - PendingIntent.FLAG_UPDATE_CURRENT)) + PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE)) .setDeleteIntent(newCancelIntent(mContext, info)); if (!TextUtils.isEmpty(info.getName())) {