From 8a38a136e17a52e821e51c23e9e83f846045173a Mon Sep 17 00:00:00 2001 From: Carlos Valdivia Date: Wed, 27 Jan 2016 12:16:25 -0800 Subject: [PATCH] Need to call getApplicationInfo from System id Otherwise it trys to enforce INTERACT_ACROSS_USERs when a package is in a different INTERACT_ACROSS_USERs. Still figuring out why this is triggering for the regular getApplicationInfo call. Change-Id: I9b07646aeaf35e2db4a6849e217129077b50b624 --- .../com/android/server/accounts/AccountManagerService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index d0006aa5c95c6..143015f0f6ab4 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java @@ -4342,6 +4342,7 @@ public class AccountManagerService String opPackageName) { List permissionsToCheck = new ArrayList(2); permissionsToCheck.add(Manifest.permission.GET_ACCOUNTS_PRIVILEGED); + long id = Binder.clearCallingIdentity(); try { ApplicationInfo appInfo = mPackageManager.getApplicationInfo( opPackageName, 0 /* flags */); @@ -4363,6 +4364,8 @@ public class AccountManagerService } catch (NameNotFoundException e) { // No application associated with the specified package. Log.w(TAG, "No application associated with package: " + opPackageName); + } finally { + Binder.restoreCallingIdentity(id); } boolean isPermitted = isPermitted(opPackageName, callingUid, permissionsToCheck); return getTypesForCaller(callingUid, userId, isPermitted);