Add the FLAG_IMMUTABLE flag for creating a PendingIntent
- Android S+ to specify explicitly either FLAG_MUTABLE or FLAG_IMMUTABLE when creating a PendingIntent. Fixes: 170162598 Fixes: 170162878 Fixes: 170163592 Fixes: 170164316 Fixes: 170164458 Fixes: 170164327 Fixes: 169794524 Fixes: 170165106 Test: build pass and manual test add an account Change-Id: I0f7b117273647dbe9e146033b8995c8c6f147576
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user