summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/accounts
diff options
context:
space:
mode:
authorMaggie Benthall <mbenthall@google.com>2013-03-14 18:02:12 -0400
committerMaggie Benthall <mbenthall@google.com>2013-03-27 18:14:29 -0400
commita12fccf57d5ec289793699d9b22ff45daccd3933 (patch)
treec100fe02b0b544cfe129d5ce3f3341dac3389e0a /services/java/com/android/server/accounts
parent7cd9ed195ba5242b125eb58a36ea2b01a588dbdd (diff)
downloadframeworks_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.java10
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;
}
}