Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
fixup! uid
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Aug 13, 2024
1 parent ce59d0b commit 4b859ae
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21326,14 +21326,14 @@ private void installPlay(int targetUserId, int callerUserId) {
// as this is not possible later if changing that setting is blocked
// It will appear as "set by admin"

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

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

mInjector.getAppOpsManager().setMode(AppOpsManager.OP_USER_TRUSTED_SOURCE, storeAi.uid,
mInjector.getAppOpsManager().setMode(AppOpsManager.OP_USER_TRUSTED_SOURCE, storeUid,
PackageId.PLAY_STORE_NAME, MODE_ALLOWED);
} catch (RemoteException e) {
// Does not happen, same process
Expand Down

0 comments on commit 4b859ae

Please sign in to comment.