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

Commit

Permalink
Stop marking apps as privileged if they are not signed properly.
Browse files Browse the repository at this point in the history
Fixes: 311374917
Test: atest android.content.pm.cts.PackageManagerTest
(cherry picked from commit 3ee5dfd)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:06775341ad7d77410798f95117cbee7a1a02c201)
Merged-In: I5b5b81cf43b06837a22c8dfd170a112106dd64c1
Change-Id: I5b5b81cf43b06837a22c8dfd170a112106dd64c1
  • Loading branch information
alexbuy authored and thestinger committed Apr 1, 2024
1 parent 2938b22 commit 208e2f1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4614,7 +4614,9 @@ private void assertOverlayIsValid(AndroidPackage pkg,

private void assertPackageWithSharedUserIdIsPrivileged(AndroidPackage pkg)
throws PackageManagerException {
if (!AndroidPackageLegacyUtils.isPrivileged(pkg) && (pkg.getSharedUserId() != null)) {
if (!AndroidPackageLegacyUtils.isPrivileged(pkg)
&& (pkg.getSharedUserId() != null)
&& !pkg.isLeavingSharedUser()) {
SharedUserSetting sharedUserSetting = null;
try {
synchronized (mPm.mLock) {
Expand Down Expand Up @@ -4654,7 +4656,8 @@ private void assertPackageWithSharedUserIdIsPrivileged(AndroidPackage pkg)
if (((scanFlags & SCAN_AS_PRIVILEGED) == 0)
&& !AndroidPackageLegacyUtils.isPrivileged(pkg)
&& (pkg.getSharedUserId() != null)
&& !skipVendorPrivilegeScan) {
&& !skipVendorPrivilegeScan
&& !pkg.isLeavingSharedUser()) {
SharedUserSetting sharedUserSetting = null;
synchronized (mPm.mLock) {
try {
Expand Down

0 comments on commit 208e2f1

Please sign in to comment.