OSDN Git Service

DO NOT MERGE Make intents immutable
authorJulia Reynolds <juliacr@google.com>
Thu, 28 May 2020 14:45:19 +0000 (10:45 -0400)
committerAnis Assi <anisassi@google.com>
Thu, 4 Jun 2020 18:25:48 +0000 (11:25 -0700)
Test: make
Fixes: 154719656
Change-Id: I212ca5f1a48174ed85311b551259da314718f082
(cherry picked from commit 36b3352784ae90326a2b308542b1d2cfe18661a0)
(cherry picked from commit 5571013bfb5d60a7c6292746f9a380cd135da9f5)

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java

index 4ae1393..ea22486 100644 (file)
@@ -568,7 +568,8 @@ public class PhoneStatusBarPolicy implements Callback, Callbacks,
         String message = mContext.getString(R.string.instant_apps_message);
         PendingIntent appInfoAction = PendingIntent.getActivity(mContext, 0,
                 new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
-                        .setData(Uri.fromParts("package", pkg, null)), 0);
+                        .setData(Uri.fromParts("package", pkg, null)),
+                        PendingIntent.FLAG_IMMUTABLE);
         Action action = new Notification.Action.Builder(null, mContext.getString(R.string.app_info),
                 appInfoAction).build();
 
@@ -582,7 +583,7 @@ public class PhoneStatusBarPolicy implements Callback, Callbacks,
                     .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 
             PendingIntent pendingIntent = PendingIntent.getActivity(mContext,
-                    0 /* requestCode */, browserIntent, 0 /* flags */);
+                    0 /* requestCode */, browserIntent, PendingIntent.FLAG_IMMUTABLE);
             ComponentName aiaComponent = null;
             try {
                 aiaComponent = AppGlobals.getPackageManager().getInstantAppInstallerComponent();
@@ -598,7 +599,8 @@ public class PhoneStatusBarPolicy implements Callback, Callbacks,
                     .putExtra(Intent.EXTRA_VERSION_CODE, appInfo.versionCode)
                     .putExtra(Intent.EXTRA_EPHEMERAL_FAILURE, pendingIntent);
 
-            PendingIntent webPendingIntent = PendingIntent.getActivity(mContext, 0, goToWebIntent, 0);
+            PendingIntent webPendingIntent = PendingIntent.getActivity(
+                    mContext, 0, goToWebIntent, PendingIntent.FLAG_IMMUTABLE);
             Action webAction = new Notification.Action.Builder(null, mContext.getString(R.string.go_to_web),
                     webPendingIntent).build();
             builder.addAction(webAction);