Add the explicitly mutable flag for creating a PendingIntent

- Android S+ to specify explicitly either FLAG_MUTABLE or FLAG_IMMUTABLE
  when creating a PendingIntent.
- Suggest to use the FLAG_IMMUTABLE as default. Change it to
  FLAG_MUTABLE while errors occur.

Fixes: 172207262
Fixes: 172207195
Fixes: 172205385
Fixes: 172204525
Fixes: 172205897
Test: build pass, manual test to paring blutooth device and doing
seamless transfer

Change-Id: Ic37b37bdbe6de6bdbad741985d3a920334240d80
This commit is contained in:
Hugh Chen
2020-11-03 12:08:45 +08:00
parent 5f5d754af2
commit 40d4e47b05
5 changed files with 21 additions and 12 deletions

View File

@@ -194,7 +194,7 @@ public class MediaOutputGroupSlice implements CustomSliceable {
intent.putExtra(CUSTOMIZED_ACTION, action);
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
return PendingIntent.getBroadcast(mContext, requestCode, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
private MediaDeviceUpdateWorker getWorker() {