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

Commit 8c61e39e authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Block new installs into ASEC containers.

ASEC containers have been deprecated since MNC, which is when we
introduced the "adoptable storage" feature.  Adoptable storage is a
much better user experience, since we move both the APK and private
app data together as a single unit, making it much easier to explain
to users.

Test: builds, boots
Bug: 32913676
Change-Id: I97385d081a50a79fc005d4e23e09999f9ae6cfc1
parent 830d4b42
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
@@ -12998,6 +12998,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);