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

Commit 870b8f9e authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Reserving an API EXTRA for Data Loader Type in installation.

Test: atest PackageManagerShellCommandTest SplitTests
Bug: b/136132412 b/133435829
Change-Id: I6489be41f8cd61abca2c8a75d39f543f5f23cc92
parent 48a488aa
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2118,6 +2118,10 @@ package android.content.pm {
  public class PackageInstaller {
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean);
    field public static final int DATA_LOADER_TYPE_INCREMENTAL = 2; // 0x2
    field public static final int DATA_LOADER_TYPE_NONE = 0; // 0x0
    field public static final int DATA_LOADER_TYPE_STREAMING = 1; // 0x1
    field public static final String EXTRA_DATA_LOADER_TYPE = "android.content.pm.extra.DATA_LOADER_TYPE";
  }
  public static class PackageInstaller.Session implements java.io.Closeable {
+40 −0
Original line number Diff line number Diff line
@@ -221,6 +221,19 @@ public class PackageInstaller {
    /** {@hide} */
    public static final String EXTRA_CALLBACK = "android.content.pm.extra.CALLBACK";

    /**
     * Type of DataLoader for this session. Will be one of
     * {@link #DATA_LOADER_TYPE_NONE}, {@link #DATA_LOADER_TYPE_STREAMING},
     * {@link #DATA_LOADER_TYPE_INCREMENTAL}.
     * <p>
     * See the individual types documentation for details.
     *
     * @see Intent#getIntExtra(String, int)
     * {@hide}
     */
    @SystemApi
    public static final String EXTRA_DATA_LOADER_TYPE = "android.content.pm.extra.DATA_LOADER_TYPE";

    /**
     * Streaming installation pending.
     * Caller should make sure DataLoader is able to prepare image and reinitiate the operation.
@@ -325,6 +338,33 @@ public class PackageInstaller {
     */
    public static final int STATUS_FAILURE_INCOMPATIBLE = 7;

    /**
     * Default value, non-streaming installation session.
     *
     * @see #EXTRA_DATA_LOADER_TYPE
     * {@hide}
     */
    @SystemApi
    public static final int DATA_LOADER_TYPE_NONE = DataLoaderType.NONE;

    /**
     * Streaming installation using data loader.
     *
     * @see #EXTRA_DATA_LOADER_TYPE
     * {@hide}
     */
    @SystemApi
    public static final int DATA_LOADER_TYPE_STREAMING = DataLoaderType.STREAMING;

    /**
     * Streaming installation using Incremental FileSystem.
     *
     * @see #EXTRA_DATA_LOADER_TYPE
     * {@hide}
     */
    @SystemApi
    public static final int DATA_LOADER_TYPE_INCREMENTAL = DataLoaderType.INCREMENTAL;

    private final IPackageInstaller mInstaller;
    private final int mUserId;
    private final String mInstallerPackageName;