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:
Sunny Shao
2020-10-06 11:46:08 +08:00
parent 98c7ad9953
commit 334968c113
8 changed files with 16 additions and 12 deletions

View File

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