Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63a127b0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ignore user portion when checking for system uid"

parents 3cecbe7f f7cc6b28
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -712,13 +712,13 @@ public class UsageStatsService extends SystemService implements

            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;
        }