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

Commit 82d3041f authored by Amith Yamasani's avatar Amith Yamasani
Browse files

DO NOT MERGE Fix security exception due to incorrect flags

Caught by test UsageStatsTest due to stricter checks for
MATCH_ANY_USER.

Change-Id: Ie884c7007a8588a222773fba8d7967bcdf2a528a
Fixes: 109700742
Test: atest CtsUsageStatsTestCases:UsageStatsTest
parent b4e4fc3a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -710,7 +710,7 @@ public class UsageStatsService extends SystemService implements
            final int callingUid = Binder.getCallingUid();
            final int callingUserId = UserHandle.getUserId(callingUid);

            if (mPackageManagerInternal.getPackageUid(pkg, PackageManager.MATCH_ANY_USER,
            if (mPackageManagerInternal.getPackageUid(pkg, /*flags=*/ 0,
                    callingUserId) != callingUid) {
                throw new SecurityException("Calling uid " + pkg + " cannot query events"
                        + "for package " + pkg);