Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 4b859ae

Browse files
committed
fixup! uid
1 parent ce59d0b commit 4b859ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21326,14 +21326,14 @@ private void installPlay(int targetUserId, int callerUserId) {
2132621326
// as this is not possible later if changing that setting is blocked
2132721327
// It will appear as "set by admin"
2132821328

21329-
final ApplicationInfo storeAi = mIPackageManager.getApplicationInfo(
21329+
final int storeUid = mIPackageManager.getPackageUid(
2133021330
PackageId.PLAY_STORE_NAME, /* flags= */ 0, targetUserId);
21331-
mInjector.getAppOpsManager().setMode(AppOpsManager.OP_REQUEST_INSTALL_PACKAGES, storeAi.uid,
21331+
mInjector.getAppOpsManager().setMode(AppOpsManager.OP_REQUEST_INSTALL_PACKAGES, storeUid,
2133221332
PackageId.PLAY_STORE_NAME, MODE_ALLOWED);
2133321333

2133421334
Slogf.d(LOG_TAG, "Granting USER_TRUSTED_SOURCE to Play Store");
2133521335

21336-
mInjector.getAppOpsManager().setMode(AppOpsManager.OP_USER_TRUSTED_SOURCE, storeAi.uid,
21336+
mInjector.getAppOpsManager().setMode(AppOpsManager.OP_USER_TRUSTED_SOURCE, storeUid,
2133721337
PackageId.PLAY_STORE_NAME, MODE_ALLOWED);
2133821338
} catch (RemoteException e) {
2133921339
// Does not happen, same process

0 commit comments

Comments
 (0)