Merge "Add a mutability flag to the PendingIntent" am: 2a4ac569b0 am: 0cfb318d10 am: 49a146399c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1456120 Change-Id: I7018d8afbd43690810d6b00683c6e7d26091e8ae
This commit is contained in:
@@ -70,7 +70,8 @@ public class VpnConfig implements Parcelable {
|
|||||||
intent.setClassName(DIALOGS_PACKAGE, DIALOGS_PACKAGE + ".ManageDialog");
|
intent.setClassName(DIALOGS_PACKAGE, DIALOGS_PACKAGE + ".ManageDialog");
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_HISTORY |
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_HISTORY |
|
||||||
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
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)
|
public static CharSequence getVpnLabel(Context context, String packageName)
|
||||||
|
|||||||
@@ -159,8 +159,9 @@ public class LingerMonitor {
|
|||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
protected PendingIntent createNotificationIntent() {
|
protected PendingIntent createNotificationIntent() {
|
||||||
return PendingIntent.getActivityAsUser(mContext, 0, CELLULAR_SETTINGS,
|
return PendingIntent.getActivityAsUser(mContext, 0 /* requestCode */, CELLULAR_SETTINGS,
|
||||||
PendingIntent.FLAG_CANCEL_CURRENT, null, UserHandle.CURRENT);
|
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.
|
// Removes any notification that was put up as a result of switching to nai.
|
||||||
|
|||||||
@@ -325,7 +325,8 @@ public class NetworkNotificationManager {
|
|||||||
public void setProvNotificationVisible(boolean visible, int id, String action) {
|
public void setProvNotificationVisible(boolean visible, int id, String action) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
Intent intent = new Intent(action);
|
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);
|
showNotification(id, NotificationType.SIGN_IN, null, null, pendingIntent, false);
|
||||||
} else {
|
} else {
|
||||||
clearNotification(id);
|
clearNotification(id);
|
||||||
|
|||||||
@@ -95,11 +95,13 @@ public class LockdownVpnTracker {
|
|||||||
mProfile = Objects.requireNonNull(profile);
|
mProfile = Objects.requireNonNull(profile);
|
||||||
|
|
||||||
final Intent configIntent = new Intent(ACTION_VPN_SETTINGS);
|
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);
|
final Intent resetIntent = new Intent(ACTION_LOCKDOWN_RESET);
|
||||||
resetIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
|
resetIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
|
||||||
mResetIntent = PendingIntent.getBroadcast(mContext, 0, resetIntent, 0);
|
mResetIntent = PendingIntent.getBroadcast(mContext, 0 /* requestCode */, resetIntent,
|
||||||
|
PendingIntent.FLAG_IMMUTABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user