From e59fc5fe55bc792f525c7ed2a4bc789639d88ed1 Mon Sep 17 00:00:00 2001 From: Dmitry Dementyev Date: Fri, 8 Jul 2016 10:46:22 -0700 Subject: [PATCH] Include correct account id in action_called_account_remove log message. Bug: 30013930 Change-Id: I857866e224d8dbc986c3b7e83a5f4e899e09f3ab --- .../accounts/AccountManagerService.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index f7bd04b08ede2..39f054c81a8f7 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java @@ -1555,9 +1555,15 @@ public class AccountManagerService } } } - - logRecord(accounts, DebugDbHelper.ACTION_CALLED_ACCOUNT_REMOVE, TABLE_ACCOUNTS); - + SQLiteDatabase db = accounts.openHelper.getReadableDatabase(); + final long accountId = getAccountIdLocked(db, account); + logRecord( + db, + DebugDbHelper.ACTION_CALLED_ACCOUNT_REMOVE, + TABLE_ACCOUNTS, + accountId, + accounts, + callingUid); try { new RemoveAccountSession(accounts, response, account, expectActivityLaunch).bind(); } finally { @@ -1589,7 +1595,15 @@ public class AccountManagerService throw new SecurityException(msg); } UserAccounts accounts = getUserAccountsForCaller(); - logRecord(accounts, DebugDbHelper.ACTION_CALLED_ACCOUNT_REMOVE, TABLE_ACCOUNTS); + SQLiteDatabase db = accounts.openHelper.getReadableDatabase(); + final long accountId = getAccountIdLocked(db, account); + logRecord( + db, + DebugDbHelper.ACTION_CALLED_ACCOUNT_REMOVE, + TABLE_ACCOUNTS, + accountId, + accounts, + callingUid); long identityToken = clearCallingIdentity(); try { return removeAccountInternal(accounts, account, callingUid);