summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/accounts/AccountManagerService.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2013-03-24 17:39:28 -0700
committerAmith Yamasani <yamasani@google.com>2013-03-26 15:09:08 -0700
commit71e6c697e54a43d357cc25d87a446d140f17396a (patch)
tree9be027013fb93fae381d971ef8830ca7e31d2907 /services/java/com/android/server/accounts/AccountManagerService.java
parenta32c7e8f9df1612d690a34258c014be661dc66ca (diff)
Device Owner, a special kind of device admin
A Device Owner cannot be uninstalled and is available to all users. It must be registered before the device_provisioned flag is set. Device admins can be disabled until used, but visible to device policy manager, so that users wont be bothered with update requests. Opened up a few related APIs for use by a system-installed Device Owner. Change-Id: I847b5fe68c0f724863f778a67602b5bddc79d8e5
Diffstat (limited to 'services/java/com/android/server/accounts/AccountManagerService.java')
-rw-r--r--services/java/com/android/server/accounts/AccountManagerService.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/java/com/android/server/accounts/AccountManagerService.java b/services/java/com/android/server/accounts/AccountManagerService.java
index 09daf569349b..c4b98ad1eca5 100644
--- a/services/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/java/com/android/server/accounts/AccountManagerService.java
@@ -1425,9 +1425,9 @@ public class AccountManagerService
if (accountType == null) throw new IllegalArgumentException("accountType is null");
checkManageAccountsPermission();
- // Is user allowed to modify accounts?
- if (!getUserManager().getUserRestrictions(Binder.getCallingUserHandle())
- .getBoolean(UserManager.ALLOW_MODIFY_ACCOUNTS)) {
+ // Is user disallowed from modifying accounts?
+ if (getUserManager().getUserRestrictions(Binder.getCallingUserHandle())
+ .getBoolean(UserManager.DISALLOW_MODIFY_ACCOUNTS, false)) {
try {
response.onError(AccountManager.ERROR_CODE_USER_RESTRICTED,
"User is not allowed to add an account!");
@@ -2572,7 +2572,7 @@ public class AccountManagerService
if (callingUid != android.os.Process.myUid()) {
Bundle restrictions = getUserManager().getUserRestrictions(
new UserHandle(UserHandle.getUserId(callingUid)));
- if (!restrictions.getBoolean(UserManager.ALLOW_MODIFY_ACCOUNTS)) {
+ if (restrictions.getBoolean(UserManager.DISALLOW_MODIFY_ACCOUNTS, false)) {
return false;
}
}