Merge "Add a mutability flag to the PendingIntent" am: 315a097740 am: 0cfb318d10 am: fd2447df82

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1456120

Change-Id: I7018d8afbd43690810d6b00683c6e7d26091e8ae
This commit is contained in:
Treehugger Robot
2020-10-23 11:11:41 +00:00
committed by Automerger Merge Worker
2 changed files with 5 additions and 3 deletions

View File

@@ -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.

View File

@@ -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);