From 5579e41c6f81bba1fc1e8cc53186957e287b5dad Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Thu, 10 Sep 2015 15:30:45 -0700 Subject: [PATCH] Add op package to the UID special case handling in account manager. The account manager has a hardcoded rule to change the calling UID if the caller is the system and another UID is passed in. We have to do the same acrobatics for the app op package as if the UID changes the opPackageName will not match the new UID. If we used the passed in UID we should also use the passed in op package name. bug:23968092 Change-Id: I0c0c2a720e9edbf82001952929d990702f8650ca --- .../java/com/android/server/accounts/AccountManagerService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index d590d7aaf3dd9..d5e9a320da849 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java @@ -2607,6 +2607,7 @@ public class AccountManagerService // be passed in the original caller's uid here, which is what should be used for filtering. if (packageUid != -1 && UserHandle.isSameApp(callingUid, Process.myUid())) { callingUid = packageUid; + opPackageName = callingPackage; } List visibleAccountTypes = getTypesVisibleToCaller(callingUid, userId,