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

Commit f2d081c4 authored by chengang's avatar chengang Committed by yuanhao
Browse files

Account: Fix the risk of sqliteconnection leak



Fix the risk of sqliteconnection leak in accountmanagerservice

Bug: 71334517

Change-Id: I92a7381bceb5885f57cc46e686cf2581b5355df9
Signed-off-by: default avataryuanhao <yuanhao@xiaomi.com>
parent e4e52917
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2007,11 +2007,11 @@ public class AccountManagerService
                    getAccountRemovedReceivers(accountToRename, accounts);
                accounts.accountsDb.beginTransaction();
                Account renamedAccount = new Account(newName, accountToRename.type);
                try {
                    if ((accounts.accountsDb.findCeAccountId(renamedAccount) >= 0)) {
                        Log.e(TAG, "renameAccount failed - account with new name already exists");
                        return null;
                    }
                try {
                    final long accountId = accounts.accountsDb.findDeAccountId(accountToRename);
                    if (accountId >= 0) {
                        accounts.accountsDb.renameCeAccount(accountId, newName);