Merge "Add the explicitly mutable flag for creating a PendingIntent"
This commit is contained in:
committed by
Android (Google) Code Review
commit
3ed34cd538
@@ -247,7 +247,8 @@ public class AddAccountSettings extends Activity {
|
||||
identityIntent.setAction(SHOULD_NOT_RESOLVE);
|
||||
identityIntent.addCategory(SHOULD_NOT_RESOLVE);
|
||||
|
||||
mPendingIntent = PendingIntent.getBroadcast(this, 0, identityIntent, 0);
|
||||
mPendingIntent = PendingIntent.getBroadcast(this, 0, identityIntent,
|
||||
PendingIntent.FLAG_IMMUTABLE);
|
||||
addAccountOptions.putParcelable(KEY_CALLER_IDENTITY, mPendingIntent);
|
||||
addAccountOptions.putBoolean(EXTRA_HAS_MULTIPLE_USERS, Utils.hasMultipleUsers(this));
|
||||
AccountManager.get(this).addAccountAsUser(
|
||||
|
@@ -129,13 +129,13 @@ public class BluetoothSliceBuilder {
|
||||
private static PendingIntent getPrimaryAction(Context context) {
|
||||
final Intent intent = getIntent(context);
|
||||
return PendingIntent.getActivity(context, 0 /* requestCode */,
|
||||
intent, 0 /* flags */);
|
||||
intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
}
|
||||
|
||||
private static PendingIntent getBroadcastIntent(Context context) {
|
||||
final Intent intent = new Intent(ACTION_BLUETOOTH_SLICE_CHANGED)
|
||||
.setClass(context, SliceBroadcastReceiver.class);
|
||||
return PendingIntent.getBroadcast(context, 0 /* requestCode */, intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
|
||||
}
|
||||
}
|
||||
|
@@ -163,7 +163,8 @@ public class BatteryFixSlice implements CustomSliceable {
|
||||
|
||||
private PendingIntent getPrimaryAction() {
|
||||
final Intent intent = getIntent();
|
||||
return PendingIntent.getActivity(mContext, 0 /* requestCode */, intent, 0 /* flags */);
|
||||
return PendingIntent.getActivity(mContext, 0 /* requestCode */, intent,
|
||||
PendingIntent.FLAG_IMMUTABLE);
|
||||
}
|
||||
|
||||
private Slice buildBatteryGoodSlice(ListBuilder sliceBuilder, boolean isError) {
|
||||
|
@@ -116,8 +116,8 @@ public class LowStorageSlice implements CustomSliceable {
|
||||
|
||||
private RowBuilder buildRowBuilder(CharSequence title, String summary, IconCompat icon) {
|
||||
final SliceAction primarySliceAction = SliceAction.createDeeplink(
|
||||
PendingIntent.getActivity(mContext, 0, getIntent(), 0), icon,
|
||||
ListBuilder.ICON_IMAGE, title);
|
||||
PendingIntent.getActivity(mContext, 0, getIntent(), PendingIntent.FLAG_IMMUTABLE),
|
||||
icon, ListBuilder.ICON_IMAGE, title);
|
||||
|
||||
return new RowBuilder()
|
||||
.setTitleItem(icon, ListBuilder.ICON_IMAGE)
|
||||
|
@@ -96,6 +96,6 @@ public class LocationSlice implements CustomSliceable {
|
||||
private PendingIntent getPrimaryAction() {
|
||||
final Intent intent = getIntent();
|
||||
return PendingIntent.getActivity(mContext, 0 /* requestCode */,
|
||||
intent, 0 /* flags */);
|
||||
intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
}
|
||||
}
|
||||
|
@@ -142,13 +142,14 @@ public class ZenModeSliceBuilder {
|
||||
|
||||
private static PendingIntent getPrimaryAction(Context context) {
|
||||
final Intent intent = getIntent(context);
|
||||
return PendingIntent.getActivity(context, 0 /* requestCode */, intent, 0 /* flags */);
|
||||
return PendingIntent.getActivity(context, 0 /* requestCode */, intent,
|
||||
PendingIntent.FLAG_IMMUTABLE);
|
||||
}
|
||||
|
||||
private static PendingIntent getBroadcastIntent(Context context) {
|
||||
final Intent intent = new Intent(ACTION_ZEN_MODE_SLICE_CHANGED)
|
||||
.setClass(context, SliceBroadcastReceiver.class);
|
||||
return PendingIntent.getBroadcast(context, 0 /* requestCode */, intent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
|
||||
}
|
||||
}
|
||||
|
@@ -95,7 +95,7 @@ public interface CustomSliceable extends Sliceable {
|
||||
.setData(getUri())
|
||||
.setClass(context, SliceBroadcastReceiver.class);
|
||||
return PendingIntent.getBroadcast(context, 0 /* requestCode */, intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -159,7 +159,7 @@ public class SliceBuilderUtils {
|
||||
.setClass(context, SliceBroadcastReceiver.class)
|
||||
.putExtra(EXTRA_SLICE_KEY, data.getKey());
|
||||
return PendingIntent.getBroadcast(context, 0 /* requestCode */, intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,7 +167,8 @@ public class SliceBuilderUtils {
|
||||
*/
|
||||
public static PendingIntent getContentPendingIntent(Context context, SliceData sliceData) {
|
||||
final Intent intent = getContentIntent(context, sliceData);
|
||||
return PendingIntent.getActivity(context, 0 /* requestCode */, intent, 0 /* flags */);
|
||||
return PendingIntent.getActivity(context, 0 /* requestCode */, intent,
|
||||
PendingIntent.FLAG_IMMUTABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user