Ignore user portion when checking for system uid

In UsageStatsService, the calling uid is considered
from the system regardeless of the curret user id

Change-Id: I5c33db37c585ac918a09ad9014bb819b1e24d7f8
Fixes: 110527624
Test: manual
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java
index b8dfd38..5239fe5 100644
--- a/services/usage/java/com/android/server/usage/UsageStatsService.java
+++ b/services/usage/java/com/android/server/usage/UsageStatsService.java
@@ -712,13 +712,13 @@
 
             if (mPackageManagerInternal.getPackageUid(pkg, /*flags=*/ 0,
                     callingUserId) != callingUid) {
-                throw new SecurityException("Calling uid " + pkg + " cannot query events"
+                throw new SecurityException("Calling uid " + callingUid + " cannot query events"
                         + "for package " + pkg);
             }
         }
 
         private boolean isCallingUidSystem() {
-            final int uid = Binder.getCallingUid();
+            final int uid = UserHandle.getAppId(Binder.getCallingUid()); // ignores user
             return uid == Process.SYSTEM_UID;
         }