Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf50dcf5 authored by Dmitry Dementyev's avatar Dmitry Dementyev
Browse files

Correctly update database during account rename.

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

Test: Verified with CTS tests.
Change-Id: I3ef8890b9a68d17208a5681a39a0895feaff5fa1
parent 6bc6b6fe
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -1881,7 +1881,13 @@ public class AccountManagerService
                final long accountId = accounts.accountsDb.findDeAccountId(accountToRename);
                final long accountId = accounts.accountsDb.findDeAccountId(accountToRename);
                if (accountId >= 0) {
                if (accountId >= 0) {
                    accounts.accountsDb.renameCeAccount(accountId, newName);
                    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 {
            } finally {
                accounts.accountsDb.endTransaction();
                accounts.accountsDb.endTransaction();