commit | 7b3ea13b177ca92f02a98fe0e1bea67b60abd084 | [log] [tgz] |
---|---|---|
author | Dmitry Dementyev <dementyev@google.com> | Wed May 10 12:45:02 2017 -0700 |
committer | Dmitry Dementyev <dementyev@google.com> | Thu May 11 12:19:28 2017 -0700 |
tree | 79381cced748606fce9029e306cafc06a9d551ff | |
parent | 897f88340969e7ad06cb978ff5e50bc4eecd23c9 [diff] [blame] |
Don't request account access for apps if it is explictly made not visible to them. Test: manual. Bug: 38190080 Change-Id: Ifc9023cb37f05f29a2d2076dcff75b710efb6276
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index 03da5b2..9d2b86c 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -5922,6 +5922,13 @@ return; } + int visibility = + resolveAccountVisibility(account, packageName, getUserAccounts(userId)); + if (visibility == AccountManager.VISIBILITY_NOT_VISIBLE) { + Slog.w(TAG, "requestAccountAccess: account is hidden"); + return; + } + if (AccountManagerService.this.hasAccountAccess(account, packageName, new UserHandle(userId))) { Bundle result = new Bundle();