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

Commit e1125aee authored by Amith Yamasani's avatar Amith Yamasani Committed by android-build-team Robot
Browse files

Fix crash on calling getAppStandbyBucket()

MATCH_ANY_USER, which was locked down recently, is not
really needed in this context, so removed it.

Bug: 111145886
Test: cts CtsAppUsageHostTestCases
Change-Id: I1bb9df0c7370015365bea414599b2b83084a1846
(cherry picked from commit 99e1424e)
parent 5ece11b5
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -924,8 +924,7 @@ public class UsageStatsService extends SystemService implements
            } catch (RemoteException re) {
                throw re.rethrowFromSystemServer();
            }
            final int packageUid = mPackageManagerInternal.getPackageUid(packageName,
                    PackageManager.MATCH_ANY_USER, userId);
            final int packageUid = mPackageManagerInternal.getPackageUid(packageName, 0, userId);
            // If the calling app is asking about itself, continue, else check for permission.
            if (packageUid != callingUid) {
                if (!hasPermission(callingPackage)) {