summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimranjit Kohli <simranjit@google.com>2015-08-10 21:36:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-08-10 21:36:30 +0000
commit301dfe08bc662e9475739309a0ccbce2231ecddb (patch)
tree0f5d34d93ba2f220d95a08d80ec00404f7f80828
parentc52839277b8714d150a9fe276b6ba3fa8a0cbf38 (diff)
parentb77d8b60857be5f5724b080ca42d2dfb2755e0fb (diff)
downloadframeworks_base-301dfe08bc662e9475739309a0ccbce2231ecddb.zip
frameworks_base-301dfe08bc662e9475739309a0ccbce2231ecddb.tar.gz
frameworks_base-301dfe08bc662e9475739309a0ccbce2231ecddb.tar.bz2
Merge "[Fix getAccounts MANAGE_USERS permission]" into mnc-dev
-rw-r--r--services/core/java/com/android/server/accounts/AccountManagerService.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 83e8db0..aab6374 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -2604,7 +2604,8 @@ public class AccountManagerService
// Prune the list down to just the requested type.
visibleAccountTypes = new ArrayList<>();
visibleAccountTypes.add(type);
- } // else aggregate all the visible accounts (it won't matter if the list is empty).
+ } // else aggregate all the visible accounts (it won't matter if the
+ // list is empty).
long identityToken = clearCallingIdentity();
try {
@@ -3788,8 +3789,15 @@ public class AccountManagerService
private List<String> getTypesForCaller(
int callingUid, int userId, boolean isOtherwisePermitted) {
List<String> managedAccountTypes = new ArrayList<>();
+ long identityToken = Binder.clearCallingIdentity();
+ Collection<RegisteredServicesCache.ServiceInfo<AuthenticatorDescription>> serviceInfos;
+ try {
+ serviceInfos = mAuthenticatorCache.getAllServices(userId);
+ } finally {
+ Binder.restoreCallingIdentity(identityToken);
+ }
for (RegisteredServicesCache.ServiceInfo<AuthenticatorDescription> serviceInfo :
- mAuthenticatorCache.getAllServices(userId)) {
+ serviceInfos) {
final int sigChk = mPackageManager.checkSignatures(serviceInfo.uid, callingUid);
if (isOtherwisePermitted || sigChk == PackageManager.SIGNATURE_MATCH) {
managedAccountTypes.add(serviceInfo.type.type);