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

Commit 2699f065 authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Add ephemeral installs

* Add a new --ephemeral argument to 'adb install'
* Add plumbing to internally track ephemeralness
* Create new app directory for ephemeral installs

Bug: 25119046
Change-Id: I1d379f5ccd42e9444c9051eef2d025a37bd824fe
parent 362ab0dd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -458,6 +458,8 @@ public final class Pm {
                params.setSize(Long.parseLong(nextOptionData()));
            } else if (opt.equals("--abi")) {
                params.abiOverride = checkAbiArgument(nextOptionData());
            } else if (opt.equals("--ephemeral")) {
                params.installFlags |= PackageManager.INSTALL_EPHEMERAL;
            } else if (opt.equals("--user")) {
                userId = Integer.parseInt(nextOptionData());
            } else if (opt.equals("--install-location")) {
+7 −0
Original line number Diff line number Diff line
@@ -382,6 +382,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
     */
    public static final int FLAG_HARDWARE_ACCELERATED = 1<<29;

    /**
     * Value for {@link #flags}: {@code true} if the application is blocked via restrictions
     * and for most purposes is considered as not installed.
     * {@hide}
     */
    public static final int FLAG_EPHEMERAL = 1<<30;

    /**
     * Value for {@link #flags}: true if code from this application will need to be
     * loaded into other applications' processes. On devices that support multiple
+16 −0
Original line number Diff line number Diff line
@@ -453,6 +453,14 @@ public abstract class PackageManager {
     */
    public static final int INSTALL_QUICK = 0x00000800;

    /**
     * Flag parameter for {@link #installPackage} to indicate that this package is
     * to be installed as a lightweight "ephemeral" app.
     *
     * @hide
     */
    public static final int INSTALL_EPHEMERAL = 0x00001000;

    /**
     * Flag parameter for
     * {@link #setComponentEnabledSetting(android.content.ComponentName, int, int)} to indicate
@@ -861,6 +869,14 @@ public abstract class PackageManager {
    /** {@hide} */
    public static final int INSTALL_FAILED_ABORTED = -115;

    /**
     * Installation failed return code: ephemeral app installs are incompatible with some
     * other installation flags supplied for the operation; or other circumstances such
     * as trying to upgrade a system app via an ephemeral install.
     * @hide
     */
    public static final int INSTALL_FAILED_EPHEMERAL_INVALID = -116;

    /**
     * Flag parameter for {@link #deletePackage} to indicate that you don't want to delete the
     * package's data directory.
+1 −0
Original line number Diff line number Diff line
@@ -627,6 +627,7 @@ public class PackageParser {
    public final static int PARSE_ENFORCE_CODE = 1<<10;
    // TODO: fix b/25118622; remove this entirely once signature processing is quick
    public final static int PARSE_SKIP_VERIFICATION = 1<<11;
    public final static int PARSE_IS_EPHEMERAL = 1<<12;

    private static final Comparator<String> sSplitNameComparator = new SplitNameComparator();

+5 −0
Original line number Diff line number Diff line
@@ -234,6 +234,11 @@ public class Environment {
        return new File(getDataDirectory(volumeUuid), "app");
    }

    /** {@hide} */
    public static File getDataAppEphemeralDirectory(String volumeUuid) {
        return new File(getDataDirectory(volumeUuid), "app-ephemeral");
    }

    /** {@hide} */
    @Deprecated
    public static File getDataUserDirectory(String volumeUuid) {
Loading