summaryrefslogtreecommitdiff
path: root/packages/Shell/src
diff options
context:
space:
mode:
author Jeff Sharkey <jsharkey@android.com> 2020-10-20 16:20:52 -0600
committer Jeff Sharkey <jsharkey@android.com> 2020-10-20 16:20:54 -0600
commit864524af17bb8ffd2ecbbc721add6b678b63d686 (patch)
treeabb5efa8a728310eb38e9ebefa82846f0d378e87 /packages/Shell/src
parentc0e3a096904519657bdf808a725e61848132a7f1 (diff)
Apply FLAG_IMMUTABLE to various PendingIntents.
Some careful spot-checking has revealed common cases where it's reasonable to blanket apply the new FLAG_IMMUTABLE option to newly created PendingIntents. Specifically these situations: -- Simple notification content clicks are immutable; there's no need to communicate customized data back to the creator -- Simple notification action clicks are immutable; there's no need to communicate customized data back to the creator -- Broadcast intents sent by AlarmManager are immutable; the system dispatches them without customization. Bug: 170165227, 170424283, 170425388, 170425877 Bug: 169791183, 170771965, 170226088, 170224928, 170767530 Test: none Change-Id: I5ed68710d2ccad4635a30fd91136a9e6ad76a01d
Diffstat (limited to 'packages/Shell/src')
-rw-r--r--packages/Shell/src/com/android/shell/BugreportProgressService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java
index 0eac4add7b09..02751e27874d 100644
--- a/packages/Shell/src/com/android/shell/BugreportProgressService.java
+++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java
@@ -737,18 +737,20 @@ public class BugreportProgressService extends Service {
final Intent infoIntent = new Intent(mContext, BugreportProgressService.class);
infoIntent.setAction(INTENT_BUGREPORT_INFO_LAUNCH);
infoIntent.putExtra(EXTRA_ID, info.id);
+ // Simple notification action button clicks are immutable
final PendingIntent infoPendingIntent =
PendingIntent.getService(mContext, info.id, infoIntent,
- PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
final Action infoAction = new Action.Builder(null,
mContext.getString(R.string.bugreport_info_action),
infoPendingIntent).build();
final Intent screenshotIntent = new Intent(mContext, BugreportProgressService.class);
screenshotIntent.setAction(INTENT_BUGREPORT_SCREENSHOT);
screenshotIntent.putExtra(EXTRA_ID, info.id);
+ // Simple notification action button clicks are immutable
PendingIntent screenshotPendingIntent = mTakingScreenshot ? null : PendingIntent
.getService(mContext, info.id, screenshotIntent,
- PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
final Action screenshotAction = new Action.Builder(null,
mContext.getString(R.string.bugreport_screenshot_action),
screenshotPendingIntent).build();