Don't request account access for apps if it is explictly made not visible to them.

Test: manual.
Bug: 38190080

Change-Id: Ifc9023cb37f05f29a2d2076dcff75b710efb6276
This commit is contained in:
Dmitry Dementyev
2017-05-10 12:45:02 -07:00
parent 897f883409
commit 7b3ea13b17

View File

@@ -5922,6 +5922,13 @@ public class AccountManagerService
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();