Prevent apps from spamming addAccountExplicitly. am: 551d70e1c8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15624525

Change-Id: If96923b691c90b4d2f6e247db3474aba99183383
This commit is contained in:
Aseem Kumar
2021-09-03 22:19:18 +00:00
committed by Automerger Merge Worker

View File

@@ -1815,8 +1815,8 @@ public class AccountManagerService
return false;
}
if (accounts.accountsDb.findAllDeAccounts().size() > 100) {
Log.w(TAG, "insertAccountIntoDatabase: " + account
+ ", skipping since more than 50 accounts on device exist");
Log.w(TAG, "insertAccountIntoDatabase: " + account.toSafeString()
+ ", skipping since more than 100 accounts on device exist");
return false;
}
long accountId = accounts.accountsDb.insertCeAccount(account, password);