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

Commit 2140cd64 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Block new installs into ASEC containers."

parents ab679895 8c61e39e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -624,8 +624,10 @@ public abstract class PackageManager {
     * should be installed as forward locked, i.e. only the app itself should
     * have access to its code and non-resource assets.
     *
     * @deprecated new installs into ASEC containers are no longer supported.
     * @hide
     */
    @Deprecated
    public static final int INSTALL_FORWARD_LOCK = 0x00000001;

    /**
@@ -648,8 +650,11 @@ public abstract class PackageManager {
     * Flag parameter for {@link #installPackage} to indicate that this package
     * must be installed to an ASEC on a {@link VolumeInfo#TYPE_PUBLIC}.
     *
     * @deprecated new installs into ASEC containers are no longer supported;
     *             use adoptable storage instead.
     * @hide
     */
    @Deprecated
    public static final int INSTALL_EXTERNAL = 0x00000008;

    /**
+6 −0
Original line number Diff line number Diff line
@@ -607,6 +607,12 @@ public class PackageInstallerService extends IPackageInstaller.Stub {
                    + "to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag");
        }

        if ((params.installFlags & PackageManager.INSTALL_FORWARD_LOCK) != 0
                || (params.installFlags & PackageManager.INSTALL_EXTERNAL) != 0) {
            throw new IllegalArgumentException(
                    "New installs into ASEC containers no longer supported");
        }

        // Defensively resize giant app icons
        if (params.appIcon != null) {
            final ActivityManager am = (ActivityManager) mContext.getSystemService(
+6 −0
Original line number Diff line number Diff line
@@ -13068,6 +13068,12 @@ public class PackageManagerService extends IPackageManager.Stub {
                    + "to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag");
        }
        if ((installFlags & PackageManager.INSTALL_FORWARD_LOCK) != 0
                || (installFlags & PackageManager.INSTALL_EXTERNAL) != 0) {
            throw new IllegalArgumentException(
                    "New installs into ASEC containers no longer supported");
        }
        final File originFile = new File(originPath);
        final OriginInfo origin = OriginInfo.fromUntrustedFile(originFile);