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
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index d590d7a..d5e9a32 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 @@
         // 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<String> visibleAccountTypes = getTypesVisibleToCaller(callingUid, userId,