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

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

Merge "[incremental/dataloader] make some class and methods system APIs"

parents 116ab8ae 4062c3ca
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -1917,6 +1917,13 @@ package android.content.pm {
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_PROFILES) public void startActivity(@NonNull android.content.ComponentName, @NonNull android.os.UserHandle);
  }
  public class DataLoaderParams {
    ctor public DataLoaderParams(@NonNull String, @NonNull String, @Nullable java.util.Map<java.lang.String,android.os.ParcelFileDescriptor>);
    method @NonNull public final java.util.Map<java.lang.String,android.os.ParcelFileDescriptor> getDynamicArgs();
    method @NonNull public final String getPackageName();
    method @NonNull public final String getStaticArgs();
  }
  public final class InstantAppInfo implements android.os.Parcelable {
    ctor public InstantAppInfo(android.content.pm.ApplicationInfo, String[], String[]);
    ctor public InstantAppInfo(String, CharSequence, String[], String[]);
@@ -2006,6 +2013,7 @@ package android.content.pm {
  }
  public static class PackageInstaller.Session implements java.io.Closeable {
    method public void addFile(@NonNull String, long, @NonNull byte[]);
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void commitTransferred(@NonNull android.content.IntentSender);
  }
@@ -2028,6 +2036,7 @@ package android.content.pm {
    method public void setDontKillApp(boolean);
    method public void setEnableRollback(boolean);
    method @RequiresPermission(android.Manifest.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS) public void setGrantedRuntimePermissions(String[]);
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setIncrementalParams(@NonNull android.content.pm.DataLoaderParams);
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setInstallAsApex();
    method public void setInstallAsInstantApp(boolean);
    method public void setInstallAsVirtualPreload();
@@ -7932,6 +7941,14 @@ package android.service.contentsuggestions {
}
package android.service.dataloader {
  public abstract class DataLoaderService extends android.app.Service {
    ctor public DataLoaderService();
  }
}
package android.service.euicc {
  public final class DownloadSubscriptionResult implements android.os.Parcelable {
+11 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.content.pm;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.os.ParcelFileDescriptor;

import java.util.Arrays;
@@ -26,9 +27,12 @@ import java.util.stream.Collectors;

/**
 * This class represents the parameters used to configure an Incremental Data Loader.
 * Hide for now.
 *
 * WARNING: This is a system API to aid internal development.
 * Use at your own risk. It will change or be removed without warning.
 * @hide
 */
@SystemApi
public class DataLoaderParams {
    @NonNull private final DataLoaderParamsParcel mData;

@@ -52,6 +56,9 @@ public class DataLoaderParams {
        mData = data;
    }

    /**
     * @hide
     */
    public DataLoaderParams(@NonNull DataLoaderParamsParcel data) {
        mData = data;
    }
@@ -70,6 +77,9 @@ public class DataLoaderParams {
        return mData.packageName;
    }

    /**
     * @hide
     */
    public final @NonNull DataLoaderParamsParcel getData() {
        return mData;
    }
+7 −1
Original line number Diff line number Diff line
@@ -1082,8 +1082,12 @@ public class PackageInstaller {
         * @throws SecurityException if called after the session has been
         *             sealed or abandoned
         * @throws IllegalStateException if called for non-callback session
         *
         * WARNING: This is a system API to aid internal development.
         * Use at your own risk. It will change or be removed without warning.
         * {@hide}
         */
        @SystemApi
        public void addFile(@NonNull String name, long lengthBytes, @NonNull byte[] metadata) {
            try {
                mSession.addFile(name, lengthBytes, metadata);
@@ -1857,9 +1861,11 @@ public class PackageInstaller {

        /**
         * Set Incremental data loader params.
         *
         * WARNING: This is a system API to aid internal development.
         * Use at your own risk. It will change or be removed without warning.
         * {@hide}
         */
        @SystemApi
        @RequiresPermission(Manifest.permission.INSTALL_PACKAGES)
        public void setIncrementalParams(@NonNull DataLoaderParams incrementalParams) {
            this.incrementalParams = incrementalParams;
+16 −5
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.service.dataloader;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.app.Service;
import android.content.Intent;
import android.content.pm.DataLoaderParams;
@@ -45,30 +46,41 @@ import java.util.List;
 * The base class for implementing data loader service to control data loaders. Expecting
 * Incremental Service to bind to a children class of this.
 *
 * @hide
 * WARNING: This is a system API to aid internal development.
 * Use at your own risk. It will change or be removed without warning.
 *
 * Hide for now, should be @SystemApi
 * TODO(b/136132412): update with latest API design
 *
 * @hide
 */
@SystemApi
public abstract class DataLoaderService extends Service {
    private static final String TAG = "IncrementalDataLoaderService";
    private final DataLoaderBinderService mBinder = new DataLoaderBinderService();

    /** @hide */
    public static final int DATA_LOADER_READY =
            IDataLoaderStatusListener.DATA_LOADER_READY;
    /** @hide */
    public static final int DATA_LOADER_NOT_READY =
            IDataLoaderStatusListener.DATA_LOADER_NOT_READY;
    /** @hide */
    public static final int DATA_LOADER_RUNNING =
            IDataLoaderStatusListener.DATA_LOADER_RUNNING;
    /** @hide */
    public static final int DATA_LOADER_STOPPED =
            IDataLoaderStatusListener.DATA_LOADER_STOPPED;
    /** @hide */
    public static final int DATA_LOADER_SLOW_CONNECTION =
            IDataLoaderStatusListener.DATA_LOADER_SLOW_CONNECTION;
    /** @hide */
    public static final int DATA_LOADER_NO_CONNECTION =
            IDataLoaderStatusListener.DATA_LOADER_NO_CONNECTION;
    /** @hide */
    public static final int DATA_LOADER_CONNECTION_OK =
            IDataLoaderStatusListener.DATA_LOADER_CONNECTION_OK;

    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(prefix = {"DATA_LOADER_"}, value = {
            DATA_LOADER_READY,
@@ -85,6 +97,7 @@ public abstract class DataLoaderService extends Service {
    /**
     * Managed DataLoader interface. Each instance corresponds to a single Incremental File System
     * instance.
     * @hide
     */
    public abstract static class DataLoader {
        /**
@@ -130,6 +143,7 @@ public abstract class DataLoaderService extends Service {
     * DataLoader factory method.
     *
     * @return An instance of a DataLoader.
     * @hide
     */
    public abstract @Nullable DataLoader onCreateDataLoader();

@@ -220,8 +234,6 @@ public abstract class DataLoaderService extends Service {
     * Used by the DataLoaderService implementations.
     *
     * @hide
     *
     * TODO(b/136132412) Should be @SystemApi
     */
    public static final class FileSystemConnector {
        /**
@@ -264,7 +276,6 @@ public abstract class DataLoaderService extends Service {
    /**
     * Wrapper for native reporting DataLoader statuses.
     * @hide
     * TODO(b/136132412) Should be @SystemApi
     */
    public static final class StatusListener {
        /**