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 99e1424e0a)
This commit is contained in:
Amith Yamasani
2018-07-11 10:44:17 -07:00
committed by android-build-team Robot
parent 5ece11b5dc
commit e1125aee3e

View File

@@ -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)) {