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

Commit a4481c9c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fail install if split is missing"

parents e96517ed 29cfa27f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -778,6 +778,7 @@ package android {
    field public static final int isModifier = 16843334; // 0x1010246
    field public static final int isRepeatable = 16843336; // 0x1010248
    field public static final int isScrollContainer = 16843342; // 0x101024e
    field public static final int isSplitRequired = 16844176; // 0x1010590
    field public static final int isStatic = 16844122; // 0x101055a
    field public static final int isSticky = 16843335; // 0x1010247
    field public static final int isolatedProcess = 16843689; // 0x10103a9
+11 −2
Original line number Diff line number Diff line
@@ -1169,6 +1169,14 @@ public abstract class PackageManager {
    @SystemApi
    public static final int INSTALL_FAILED_SANDBOX_VERSION_DOWNGRADE = -27;

    /**
     * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS}
     * if the new package requires at least one split and it was not provided.
     *
     * @hide
     */
    public static final int INSTALL_FAILED_MISSING_SPLIT = -28;

    /**
     * Installation parse return code: this is passed in the
     * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser was given a path that is not a
@@ -5927,8 +5935,8 @@ public abstract class PackageManager {
            case INSTALL_FAILED_DUPLICATE_PERMISSION: return "INSTALL_FAILED_DUPLICATE_PERMISSION";
            case INSTALL_FAILED_NO_MATCHING_ABIS: return "INSTALL_FAILED_NO_MATCHING_ABIS";
            case INSTALL_FAILED_ABORTED: return "INSTALL_FAILED_ABORTED";
            case INSTALL_FAILED_BAD_DEX_METADATA:
                return "INSTALL_FAILED_BAD_DEX_METADATA";
            case INSTALL_FAILED_BAD_DEX_METADATA: return "INSTALL_FAILED_BAD_DEX_METADATA";
            case INSTALL_FAILED_MISSING_SPLIT: return "INSTALL_FAILED_MISSING_SPLIT";
            default: return Integer.toString(status);
        }
    }
@@ -5979,6 +5987,7 @@ public abstract class PackageManager {
            case INSTALL_FAILED_DUPLICATE_PERMISSION: return PackageInstaller.STATUS_FAILURE_CONFLICT;
            case INSTALL_FAILED_NO_MATCHING_ABIS: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE;
            case INSTALL_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED;
            case INSTALL_FAILED_MISSING_SPLIT: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE;
            default: return PackageInstaller.STATUS_FAILURE;
        }
    }
+9 −3
Original line number Diff line number Diff line
@@ -452,10 +452,12 @@ public class PackageParser {
        public final boolean use32bitAbi;
        public final boolean extractNativeLibs;
        public final boolean isolatedSplits;
        public final boolean isSplitRequired;

        public ApkLite(String codePath, String packageName, String splitName,
                boolean isFeatureSplit,
                String configForSplit, String usesSplitName, int versionCode, int versionCodeMajor,
                String configForSplit, String usesSplitName, boolean isSplitRequired,
                int versionCode, int versionCodeMajor,
                int revisionCode, int installLocation, List<VerifierInfo> verifiers,
                SigningDetails signingDetails, boolean coreApp,
                boolean debuggable, boolean multiArch, boolean use32bitAbi,
@@ -478,6 +480,7 @@ public class PackageParser {
            this.use32bitAbi = use32bitAbi;
            this.extractNativeLibs = extractNativeLibs;
            this.isolatedSplits = isolatedSplits;
            this.isSplitRequired = isSplitRequired;
        }

        public long getLongVersionCode() {
@@ -1695,6 +1698,7 @@ public class PackageParser {
        boolean extractNativeLibs = true;
        boolean isolatedSplits = false;
        boolean isFeatureSplit = false;
        boolean isSplitRequired = false;
        String configForSplit = null;
        String usesSplitName = null;

@@ -1717,6 +1721,8 @@ public class PackageParser {
                configForSplit = attrs.getAttributeValue(i);
            } else if (attr.equals("isFeatureSplit")) {
                isFeatureSplit = attrs.getAttributeBooleanValue(i, false);
            } else if (attr.equals("isSplitRequired")) {
                isSplitRequired = attrs.getAttributeBooleanValue(i, false);
            }
        }

@@ -1772,8 +1778,8 @@ public class PackageParser {
        }

        return new ApkLite(codePath, packageSplit.first, packageSplit.second, isFeatureSplit,
                configForSplit, usesSplitName, versionCode, versionCodeMajor, revisionCode,
                installLocation, verifiers, signingDetails, coreApp, debuggable,
                configForSplit, usesSplitName, isSplitRequired, versionCode, versionCodeMajor,
                revisionCode, installLocation, verifiers, signingDetails, coreApp, debuggable,
                multiArch, use32bitAbi, extractNativeLibs, isolatedSplits);
    }

+5 −0
Original line number Diff line number Diff line
@@ -1102,6 +1102,10 @@
         <p>The default value of this attribute is <code>false</code>. -->
    <attr name="isFeatureSplit" format="boolean" />

    <!-- Flag to specify if this APK requires at least one split [either feature or
         resource] to be present in order to function. Default value is false. -->
    <attr name="isSplitRequired" format="boolean" />

    <!-- Extra options for an activity's UI. Applies to either the {@code <activity>} or
         {@code <application>} tag. If specified on the {@code <application>}
         tag these will be considered defaults for all activities in the
@@ -1422,6 +1426,7 @@
        <attr name="targetSandboxVersion" />
        <attr name="compileSdkVersion" />
        <attr name="compileSdkVersionCodename" />
        <attr name="isSplitRequired" />
    </declare-styleable>

    <!-- The <code>application</code> tag describes application-level components
+1 −0
Original line number Diff line number Diff line
@@ -2913,6 +2913,7 @@
        <public name="usesNonSdkApi" />
        <public name="minimumUiTimeout" />
        <public name="isLightTheme" />
        <public name="isSplitRequired" />
    </public-group>

    <public-group type="drawable" first-id="0x010800b4">
Loading