Use the correct userId when checking if disabled by admin.

And when adding accounts if only one account type is possible and
it is disabled by admin, show the admin support dialog.

Bug: 26897250
Bug: 26767564
Change-Id: I5cca64491a100efc34307c45aa35c14412f043cd
This commit is contained in:
Sudheer Shanka
2016-01-29 22:12:30 +00:00
parent 3848ddc1a0
commit f755baf1c3
7 changed files with 44 additions and 17 deletions

View File

@@ -272,7 +272,7 @@ public class AccountSyncSettings extends AccountPreferenceBase {
mUserHandle.getIdentifier());
if (admin == null) {
admin = RestrictedLockUtils.checkIfAccountManagementDisabled(
getPrefContext(), mAccount.type);
getPrefContext(), mAccount.type, mUserHandle.getIdentifier());
}
RestrictedLockUtils.setMenuItemAsDisabledByAdmin(getPrefContext(),
removeAccount, admin);