diff options
| author | 2020-10-23 11:24:41 +0000 | |
|---|---|---|
| committer | 2020-10-23 11:24:41 +0000 | |
| commit | 00a5b9b4d446db481be3b68d82834446a4eeecfa (patch) | |
| tree | d8df9a493327a2c8200a370ff4b167129ad9a598 | |
| parent | 896b3833298fcf2be3b66eb991bc2559dcb9d300 (diff) | |
| parent | a230de92fec3a6963f4f0af3fa4f32bdb8990fed (diff) | |
Merge "Add a mutability flag to the PendingIntent" am: 2a4ac569b0 am: 0cfb318d10 am: 49a146399c am: a230de92fe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1456120
Change-Id: I1e0adcc9affae154318f2e92a75ce190c97d3b10
4 files changed, 11 insertions, 6 deletions
diff --git a/core/java/com/android/internal/net/VpnConfig.java b/core/java/com/android/internal/net/VpnConfig.java index 7dc38711a6ef..c0648ab89c41 100644 --- a/core/java/com/android/internal/net/VpnConfig.java +++ b/core/java/com/android/internal/net/VpnConfig.java @@ -70,7 +70,8 @@ public class VpnConfig implements Parcelable { intent.setClassName(DIALOGS_PACKAGE, DIALOGS_PACKAGE + ".ManageDialog"); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); - return PendingIntent.getActivityAsUser(context, 0, intent, 0, null, UserHandle.CURRENT); + return PendingIntent.getActivityAsUser(context, 0 /* requestCode */, intent, + PendingIntent.FLAG_IMMUTABLE, null /* options */, UserHandle.CURRENT); } public static CharSequence getVpnLabel(Context context, String packageName) diff --git a/services/core/java/com/android/server/connectivity/LingerMonitor.java b/services/core/java/com/android/server/connectivity/LingerMonitor.java index 04c000f6453a..7fdc7a0a524f 100644 --- a/services/core/java/com/android/server/connectivity/LingerMonitor.java +++ b/services/core/java/com/android/server/connectivity/LingerMonitor.java @@ -159,8 +159,9 @@ public class LingerMonitor { @VisibleForTesting protected PendingIntent createNotificationIntent() { - return PendingIntent.getActivityAsUser(mContext, 0, CELLULAR_SETTINGS, - PendingIntent.FLAG_CANCEL_CURRENT, null, UserHandle.CURRENT); + return PendingIntent.getActivityAsUser(mContext, 0 /* requestCode */, CELLULAR_SETTINGS, + PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE, + null /* options */, UserHandle.CURRENT); } // Removes any notification that was put up as a result of switching to nai. diff --git a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java index 34b0aa246433..26356b440d09 100644 --- a/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java +++ b/services/core/java/com/android/server/connectivity/NetworkNotificationManager.java @@ -325,7 +325,8 @@ public class NetworkNotificationManager { public void setProvNotificationVisible(boolean visible, int id, String action) { if (visible) { Intent intent = new Intent(action); - PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0); + PendingIntent pendingIntent = PendingIntent.getBroadcast( + mContext, 0 /* requestCode */, intent, PendingIntent.FLAG_IMMUTABLE); showNotification(id, NotificationType.SIGN_IN, null, null, pendingIntent, false); } else { clearNotification(id); diff --git a/services/core/java/com/android/server/net/LockdownVpnTracker.java b/services/core/java/com/android/server/net/LockdownVpnTracker.java index 05f280884432..3a262d6dfafd 100644 --- a/services/core/java/com/android/server/net/LockdownVpnTracker.java +++ b/services/core/java/com/android/server/net/LockdownVpnTracker.java @@ -95,11 +95,13 @@ public class LockdownVpnTracker { mProfile = Objects.requireNonNull(profile); final Intent configIntent = new Intent(ACTION_VPN_SETTINGS); - mConfigIntent = PendingIntent.getActivity(mContext, 0, configIntent, 0); + mConfigIntent = PendingIntent.getActivity(mContext, 0 /* requestCode */, configIntent, + PendingIntent.FLAG_IMMUTABLE); final Intent resetIntent = new Intent(ACTION_LOCKDOWN_RESET); resetIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); - mResetIntent = PendingIntent.getBroadcast(mContext, 0, resetIntent, 0); + mResetIntent = PendingIntent.getBroadcast(mContext, 0 /* requestCode */, resetIntent, + PendingIntent.FLAG_IMMUTABLE); } /** |