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

Commit b80971b5 authored by Nikita Ioffe's avatar Nikita Ioffe Committed by Automerger Merge Worker
Browse files

Merge "Allow holders of INSTALL_PACKAGE_UPDATES permission to update APEXes"...

Merge "Allow holders of INSTALL_PACKAGE_UPDATES permission to update APEXes" into sc-dev am: 4173c5a5 am: 966aa89a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14965611

Change-Id: I1055700bc5502c02ba7bd7fc057f80b66a213a9b
parents 7f55f9c0 966aa89a
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -627,7 +627,14 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
        }

        boolean isApex = (params.installFlags & PackageManager.INSTALL_APEX) != 0;
        if (params.isStaged || isApex) {
        if (isApex) {
            if (mContext.checkCallingOrSelfPermission(Manifest.permission.INSTALL_PACKAGE_UPDATES)
                    == PackageManager.PERMISSION_DENIED
                    && mContext.checkCallingOrSelfPermission(Manifest.permission.INSTALL_PACKAGES)
                    == PackageManager.PERMISSION_DENIED) {
                throw new SecurityException("Not allowed to perform APEX updates");
            }
        } else if (params.isStaged) {
            mContext.enforceCallingOrSelfPermission(Manifest.permission.INSTALL_PACKAGES, TAG);
        }