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

Commit 23e88129 authored by Nikita Ioffe's avatar Nikita Ioffe Committed by Android (Google) Code Review
Browse files

Merge "PM: Reject installation of an APK with same name as an APEX" into qt-dev

parents 31a92c9c 95f648ac
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2470,6 +2470,7 @@ public class PackageManagerService extends IPackageManager.Stub
        mProtectedPackages = new ProtectedPackages(mContext);
        mApexManager = new ApexManager(context);
        synchronized (mInstallLock) {
        // writer
        synchronized (mPackages) {
@@ -3295,7 +3296,6 @@ public class PackageManagerService extends IPackageManager.Stub
                }
            }
            mApexManager = new ApexManager(context);
            mInstallerService = new PackageInstallerService(context, this, mApexManager);
            final Pair<ComponentName, String> instantAppResolverComponent =
                    getInstantAppResolverLPr();
@@ -11702,6 +11702,11 @@ public class PackageManagerService extends IPackageManager.Stub
                    "Code and resource paths haven't been set correctly");
        }
        if (mApexManager.isApexPackage(pkg.packageName)) {
            throw new PackageManagerException(INSTALL_FAILED_DUPLICATE_PACKAGE,
                    pkg.packageName + " is an APEX package and can't be installed as an APK.");
        }
        // Make sure we're not adding any bogus keyset info
        final KeySetManagerService ksms = mSettings.mKeySetManagerService;
        ksms.assertScannedPackageValid(pkg);