diff options
author | Maggie Benthall <mbenthall@google.com> | 2013-03-14 18:02:12 -0400 |
---|---|---|
committer | Maggie Benthall <mbenthall@google.com> | 2013-03-27 18:14:29 -0400 |
commit | a12fccf57d5ec289793699d9b22ff45daccd3933 (patch) | |
tree | c100fe02b0b544cfe129d5ce3f3341dac3389e0a /services/java/com/android/server/accounts | |
parent | 7cd9ed195ba5242b125eb58a36ea2b01a588dbdd (diff) | |
download | frameworks_base-a12fccf57d5ec289793699d9b22ff45daccd3933.zip frameworks_base-a12fccf57d5ec289793699d9b22ff45daccd3933.tar.gz frameworks_base-a12fccf57d5ec289793699d9b22ff45daccd3933.tar.bz2 |
Add user restrictions for bluetooth, sideloading, usb file transfer
Created constants for these in UserManager and current.txt. Also created
an accessor for individual user restrictions that takes the restriction key
(removing individual methods for particular restrictions).
Change-Id: Ibb5517cbcdffadd3925f52cbe67d7d525813faa9
Diffstat (limited to 'services/java/com/android/server/accounts')
-rw-r--r-- | services/java/com/android/server/accounts/AccountManagerService.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/services/java/com/android/server/accounts/AccountManagerService.java b/services/java/com/android/server/accounts/AccountManagerService.java index c4b98ad..18a1a39 100644 --- a/services/java/com/android/server/accounts/AccountManagerService.java +++ b/services/java/com/android/server/accounts/AccountManagerService.java @@ -906,6 +906,7 @@ public class AccountManagerService } } + @Override public void invalidateAuthToken(String accountType, String authToken) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "invalidateAuthToken: accountType " + accountType @@ -1351,7 +1352,7 @@ public class AccountManagerService String subtitle = ""; if (index > 0) { title = titleAndSubtitle.substring(0, index); - subtitle = titleAndSubtitle.substring(index + 1); + subtitle = titleAndSubtitle.substring(index + 1); } UserHandle user = new UserHandle(userId); n.setLatestEventInfo(mContext, title, subtitle, @@ -1426,8 +1427,7 @@ public class AccountManagerService checkManageAccountsPermission(); // Is user disallowed from modifying accounts? - if (getUserManager().getUserRestrictions(Binder.getCallingUserHandle()) - .getBoolean(UserManager.DISALLOW_MODIFY_ACCOUNTS, false)) { + if (getUserManager().hasUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS)) { try { response.onError(AccountManager.ERROR_CODE_USER_RESTRICTED, "User is not allowed to add an account!"); @@ -2570,9 +2570,7 @@ public class AccountManagerService private boolean canUserModifyAccounts(int callingUid) { if (callingUid != android.os.Process.myUid()) { - Bundle restrictions = getUserManager().getUserRestrictions( - new UserHandle(UserHandle.getUserId(callingUid))); - if (restrictions.getBoolean(UserManager.DISALLOW_MODIFY_ACCOUNTS, false)) { + if (getUserManager().hasUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS)) { return false; } } |