diff options
| -rw-r--r-- | core/java/android/accounts/AccountManager.java | 4 | ||||
| -rw-r--r-- | services/core/java/com/android/server/accounts/AccountManagerService.java | 12 |
2 files changed, 6 insertions, 10 deletions
diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java index 59d2f18c3a19..531b5d7d58d9 100644 --- a/core/java/android/accounts/AccountManager.java +++ b/core/java/android/accounts/AccountManager.java @@ -2785,8 +2785,6 @@ public class AccountManager { * <ul> * <li>{@link #KEY_ACCOUNT_SESSION_BUNDLE} - encrypted Bundle for * adding the the to the device later. - * <li>{@link #KEY_PASSWORD} - optional, the password or password - * hash of the account. * <li>{@link #KEY_ACCOUNT_STATUS_TOKEN} - optional, token to check * status of the account * </ul> @@ -2872,8 +2870,6 @@ public class AccountManager { * <ul> * <li>{@link #KEY_ACCOUNT_SESSION_BUNDLE} - encrypted Bundle for * updating the local credentials on device later. - * <li>{@link #KEY_PASSWORD} - optional, the password or password - * hash of the account * <li>{@link #KEY_ACCOUNT_STATUS_TOKEN} - optional, token to check * status of the account * </ul> diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index 31f14e7a77ba..53e6a5540726 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java @@ -3142,10 +3142,9 @@ public class AccountManagerService boolean isPasswordForwardingAllowed = isPermitted( callerPkg, uid, Manifest.permission.GET_PASSWORD); - int usrId = UserHandle.getCallingUserId(); long identityToken = clearCallingIdentity(); try { - UserAccounts accounts = getUserAccounts(usrId); + UserAccounts accounts = getUserAccounts(userId); logRecordWithUid(accounts, DebugDbHelper.ACTION_CALLED_START_ACCOUNT_ADD, TABLE_ACCOUNTS, uid); new StartAccountSession( @@ -3206,10 +3205,6 @@ public class AccountManagerService checkKeyIntent( Binder.getCallingUid(), intent); - // Omit passwords if the caller isn't permitted to see them. - if (!mIsPasswordForwardingAllowed) { - result.remove(AccountManager.KEY_PASSWORD); - } } IAccountManagerResponse response; if (mExpectActivityLaunch && result != null @@ -3239,6 +3234,11 @@ public class AccountManagerService return; } + // Omit passwords if the caller isn't permitted to see them. + if (!mIsPasswordForwardingAllowed) { + result.remove(AccountManager.KEY_PASSWORD); + } + // Strip auth token from result. result.remove(AccountManager.KEY_AUTHTOKEN); |