Merge "API feedback: make Installer v2 API public." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b92a4f2f37
@@ -11966,6 +11966,14 @@ package android.content.pm {
|
||||
field public static final String ACTION_CAN_INTERACT_ACROSS_PROFILES_CHANGED = "android.content.pm.action.CAN_INTERACT_ACROSS_PROFILES_CHANGED";
|
||||
}
|
||||
|
||||
public class DataLoaderParams {
|
||||
method @NonNull public static final android.content.pm.DataLoaderParams forIncremental(@NonNull android.content.ComponentName, @NonNull String);
|
||||
method @NonNull public static final android.content.pm.DataLoaderParams forStreaming(@NonNull android.content.ComponentName, @NonNull String);
|
||||
method @NonNull public final String getArguments();
|
||||
method @NonNull public final android.content.ComponentName getComponentName();
|
||||
method @NonNull public final int getType();
|
||||
}
|
||||
|
||||
public final class FeatureGroupInfo implements android.os.Parcelable {
|
||||
ctor public FeatureGroupInfo();
|
||||
ctor public FeatureGroupInfo(android.content.pm.FeatureGroupInfo);
|
||||
@@ -12194,6 +12202,10 @@ package android.content.pm {
|
||||
field public static final String ACTION_SESSION_COMMITTED = "android.content.pm.action.SESSION_COMMITTED";
|
||||
field public static final String ACTION_SESSION_DETAILS = "android.content.pm.action.SESSION_DETAILS";
|
||||
field public static final String ACTION_SESSION_UPDATED = "android.content.pm.action.SESSION_UPDATED";
|
||||
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";
|
||||
field public static final String EXTRA_OTHER_PACKAGE_NAME = "android.content.pm.extra.OTHER_PACKAGE_NAME";
|
||||
field public static final String EXTRA_PACKAGE_NAME = "android.content.pm.extra.PACKAGE_NAME";
|
||||
field public static final String EXTRA_SESSION = "android.content.pm.extra.SESSION";
|
||||
@@ -12201,6 +12213,9 @@ package android.content.pm {
|
||||
field public static final String EXTRA_STATUS = "android.content.pm.extra.STATUS";
|
||||
field public static final String EXTRA_STATUS_MESSAGE = "android.content.pm.extra.STATUS_MESSAGE";
|
||||
field public static final String EXTRA_STORAGE_PATH = "android.content.pm.extra.STORAGE_PATH";
|
||||
field public static final int LOCATION_DATA_APP = 0; // 0x0
|
||||
field public static final int LOCATION_MEDIA_DATA = 2; // 0x2
|
||||
field public static final int LOCATION_MEDIA_OBB = 1; // 0x1
|
||||
field public static final int STATUS_FAILURE = 1; // 0x1
|
||||
field public static final int STATUS_FAILURE_ABORTED = 3; // 0x3
|
||||
field public static final int STATUS_FAILURE_BLOCKED = 2; // 0x2
|
||||
@@ -12208,6 +12223,7 @@ package android.content.pm {
|
||||
field public static final int STATUS_FAILURE_INCOMPATIBLE = 7; // 0x7
|
||||
field public static final int STATUS_FAILURE_INVALID = 4; // 0x4
|
||||
field public static final int STATUS_FAILURE_STORAGE = 6; // 0x6
|
||||
field public static final int STATUS_PENDING_STREAMING = -2; // 0xfffffffe
|
||||
field public static final int STATUS_PENDING_USER_ACTION = -1; // 0xffffffff
|
||||
field public static final int STATUS_SUCCESS = 0; // 0x0
|
||||
}
|
||||
@@ -12215,10 +12231,12 @@ package android.content.pm {
|
||||
public static class PackageInstaller.Session implements java.io.Closeable {
|
||||
method public void abandon();
|
||||
method public void addChildSessionId(int);
|
||||
method public void addFile(int, @NonNull String, long, @NonNull byte[], @Nullable byte[]);
|
||||
method public void close();
|
||||
method public void commit(@NonNull android.content.IntentSender);
|
||||
method public void fsync(@NonNull java.io.OutputStream) throws java.io.IOException;
|
||||
method @NonNull public int[] getChildSessionIds();
|
||||
method @Nullable public android.content.pm.DataLoaderParams getDataLoaderParams();
|
||||
method @NonNull public String[] getNames() throws java.io.IOException;
|
||||
method public int getParentSessionId();
|
||||
method public boolean isMultiPackage();
|
||||
@@ -12292,6 +12310,7 @@ package android.content.pm {
|
||||
method public void setAppLabel(@Nullable CharSequence);
|
||||
method public void setAppPackageName(@Nullable String);
|
||||
method public void setAutoRevokePermissionsMode(boolean);
|
||||
method public void setDataLoaderParams(@NonNull android.content.pm.DataLoaderParams);
|
||||
method public void setInstallLocation(int);
|
||||
method public void setInstallReason(int);
|
||||
method public void setInstallScenario(int);
|
||||
|
||||
@@ -2382,14 +2382,6 @@ 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 {
|
||||
method @NonNull public static final android.content.pm.DataLoaderParams forIncremental(@NonNull android.content.ComponentName, @NonNull String);
|
||||
method @NonNull public static final android.content.pm.DataLoaderParams forStreaming(@NonNull android.content.ComponentName, @NonNull String);
|
||||
method @NonNull public final String getArguments();
|
||||
method @NonNull public final android.content.ComponentName getComponentName();
|
||||
method @NonNull public final int getType();
|
||||
}
|
||||
|
||||
public final class InstallationFile {
|
||||
method public long getLengthBytes();
|
||||
method public int getLocation();
|
||||
@@ -2488,19 +2480,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";
|
||||
field public static final int LOCATION_DATA_APP = 0; // 0x0
|
||||
field public static final int LOCATION_MEDIA_DATA = 2; // 0x2
|
||||
field public static final int LOCATION_MEDIA_OBB = 1; // 0x1
|
||||
}
|
||||
|
||||
public static class PackageInstaller.Session implements java.io.Closeable {
|
||||
method public void addFile(int, @NonNull String, long, @NonNull byte[], @Nullable byte[]);
|
||||
method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void commitTransferred(@NonNull android.content.IntentSender);
|
||||
method @Nullable public android.content.pm.DataLoaderParams getDataLoaderParams();
|
||||
method public void removeFile(int, @NonNull String);
|
||||
}
|
||||
|
||||
@@ -2522,7 +2505,6 @@ package android.content.pm {
|
||||
public static class PackageInstaller.SessionParams implements android.os.Parcelable {
|
||||
method @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public void setAllocateAggressive(boolean);
|
||||
method @Deprecated public void setAllowDowngrade(boolean);
|
||||
method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setDataLoaderParams(@NonNull android.content.pm.DataLoaderParams);
|
||||
method public void setDontKillApp(boolean);
|
||||
method public void setEnableRollback(boolean);
|
||||
method public void setEnableRollback(boolean, int);
|
||||
|
||||
@@ -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