Merge "API feedback: make Installer v2 API public." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b92a4f2f37
@@ -17,17 +17,11 @@
|
||||
package android.content.pm;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.SystemApi;
|
||||
import android.content.ComponentName;
|
||||
|
||||
/**
|
||||
* This class represents the parameters used to configure a Data Loader.
|
||||
*
|
||||
* 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;
|
||||
|
||||
@@ -235,9 +235,7 @@ public class PackageInstaller {
|
||||
* 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";
|
||||
|
||||
/**
|
||||
@@ -245,7 +243,6 @@ public class PackageInstaller {
|
||||
* Caller should make sure DataLoader is able to prepare image and reinitiate the operation.
|
||||
*
|
||||
* @see #EXTRA_SESSION_ID
|
||||
* {@hide}
|
||||
*/
|
||||
public static final int STATUS_PENDING_STREAMING = -2;
|
||||
|
||||
@@ -348,44 +345,33 @@ public class PackageInstaller {
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Target location for the file in installation session is /data/app/<packageName>-<id>.
|
||||
* This is the intended location for APKs.
|
||||
* Requires permission to install packages.
|
||||
* {@hide}
|
||||
*/
|
||||
@SystemApi
|
||||
public static final int LOCATION_DATA_APP = InstallationFileLocation.DATA_APP;
|
||||
|
||||
/**
|
||||
* Target location for the file in installation session is
|
||||
* /data/media/<userid>/Android/obb/<packageName>. This is the intended location for OBBs.
|
||||
* {@hide}
|
||||
*/
|
||||
@SystemApi
|
||||
public static final int LOCATION_MEDIA_OBB = InstallationFileLocation.MEDIA_OBB;
|
||||
|
||||
/**
|
||||
@@ -393,9 +379,7 @@ public class PackageInstaller {
|
||||
* /data/media/<userid>/Android/data/<packageName>.
|
||||
* This is the intended location for application data.
|
||||
* Can only be used by an app itself running under specific user.
|
||||
* {@hide}
|
||||
*/
|
||||
@SystemApi
|
||||
public static final int LOCATION_MEDIA_DATA = InstallationFileLocation.MEDIA_DATA;
|
||||
|
||||
/** @hide */
|
||||
@@ -1167,12 +1151,7 @@ public class PackageInstaller {
|
||||
|
||||
/**
|
||||
* @return data loader params or null if the session is not using one.
|
||||
*
|
||||
* 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 @Nullable DataLoaderParams getDataLoaderParams() {
|
||||
try {
|
||||
DataLoaderParamsParcel data = mSession.getDataLoaderParams();
|
||||
@@ -1206,12 +1185,7 @@ 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(@FileLocation int location, @NonNull String name, long lengthBytes,
|
||||
@NonNull byte[] metadata, @Nullable byte[] signature) {
|
||||
try {
|
||||
@@ -2041,13 +2015,7 @@ public class PackageInstaller {
|
||||
* Set the data loader params for the session.
|
||||
* This also switches installation into data provider mode and disallow direct writes into
|
||||
* staging folder.
|
||||
*
|
||||
* 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 setDataLoaderParams(@NonNull DataLoaderParams dataLoaderParams) {
|
||||
this.dataLoaderParams = dataLoaderParams;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user