Correctly update database during account rename.

Bug: https://b.corp.google.com/issues/32907996

Test: Verified with CTS tests.
Change-Id: I3ef8890b9a68d17208a5681a39a0895feaff5fa1
This commit is contained in:
Dmitry Dementyev
2016-11-17 14:14:11 -08:00
parent 6bc6b6fe5a
commit cf50dcf502

View File

@@ -1881,7 +1881,13 @@ public class AccountManagerService
final long accountId = accounts.accountsDb.findDeAccountId(accountToRename);
if (accountId >= 0) {
accounts.accountsDb.renameCeAccount(accountId, newName);
accounts.accountsDb.renameDeAccount(accountId, newName, accountToRename.name);
if (accounts.accountsDb.renameDeAccount(
accountId, newName, accountToRename.name)) {
accounts.accountsDb.setTransactionSuccessful();
} else {
Log.e(TAG, "renameAccount failed");
return null;
}
}
} finally {
accounts.accountsDb.endTransaction();