Merge "API feedback: make DataLoader API System." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
910f855fe0
@@ -12086,13 +12086,6 @@ package android.content.pm {
|
|||||||
field public static final String ACTION_CAN_INTERACT_ACROSS_PROFILES_CHANGED = "android.content.pm.action.CAN_INTERACT_ACROSS_PROFILES_CHANGED";
|
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 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 {
|
public final class FeatureGroupInfo implements android.os.Parcelable {
|
||||||
ctor public FeatureGroupInfo();
|
ctor public FeatureGroupInfo();
|
||||||
ctor public FeatureGroupInfo(android.content.pm.FeatureGroupInfo);
|
ctor public FeatureGroupInfo(android.content.pm.FeatureGroupInfo);
|
||||||
@@ -12127,14 +12120,6 @@ package android.content.pm {
|
|||||||
field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstallSourceInfo> CREATOR;
|
field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstallSourceInfo> CREATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class InstallationFile {
|
|
||||||
method public long getLengthBytes();
|
|
||||||
method public int getLocation();
|
|
||||||
method @Nullable public byte[] getMetadata();
|
|
||||||
method @NonNull public String getName();
|
|
||||||
method @Nullable public byte[] getSignature();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class InstrumentationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
|
public class InstrumentationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
|
||||||
ctor public InstrumentationInfo();
|
ctor public InstrumentationInfo();
|
||||||
ctor public InstrumentationInfo(android.content.pm.InstrumentationInfo);
|
ctor public InstrumentationInfo(android.content.pm.InstrumentationInfo);
|
||||||
@@ -12331,9 +12316,6 @@ 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_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_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 String ACTION_SESSION_UPDATED = "android.content.pm.action.SESSION_UPDATED";
|
||||||
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_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_PACKAGE_NAME = "android.content.pm.extra.PACKAGE_NAME";
|
||||||
field public static final String EXTRA_SESSION = "android.content.pm.extra.SESSION";
|
field public static final String EXTRA_SESSION = "android.content.pm.extra.SESSION";
|
||||||
@@ -12341,9 +12323,6 @@ package android.content.pm {
|
|||||||
field public static final String EXTRA_STATUS = "android.content.pm.extra.STATUS";
|
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_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 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 = 1; // 0x1
|
||||||
field public static final int STATUS_FAILURE_ABORTED = 3; // 0x3
|
field public static final int STATUS_FAILURE_ABORTED = 3; // 0x3
|
||||||
field public static final int STATUS_FAILURE_BLOCKED = 2; // 0x2
|
field public static final int STATUS_FAILURE_BLOCKED = 2; // 0x2
|
||||||
@@ -12351,7 +12330,6 @@ package android.content.pm {
|
|||||||
field public static final int STATUS_FAILURE_INCOMPATIBLE = 7; // 0x7
|
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_INVALID = 4; // 0x4
|
||||||
field public static final int STATUS_FAILURE_STORAGE = 6; // 0x6
|
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_PENDING_USER_ACTION = -1; // 0xffffffff
|
||||||
field public static final int STATUS_SUCCESS = 0; // 0x0
|
field public static final int STATUS_SUCCESS = 0; // 0x0
|
||||||
}
|
}
|
||||||
@@ -12359,12 +12337,10 @@ package android.content.pm {
|
|||||||
public static class PackageInstaller.Session implements java.io.Closeable {
|
public static class PackageInstaller.Session implements java.io.Closeable {
|
||||||
method public void abandon();
|
method public void abandon();
|
||||||
method public void addChildSessionId(int);
|
method public void addChildSessionId(int);
|
||||||
method public void addFile(int, @NonNull String, long, @NonNull byte[], @Nullable byte[]);
|
|
||||||
method public void close();
|
method public void close();
|
||||||
method public void commit(@NonNull android.content.IntentSender);
|
method public void commit(@NonNull android.content.IntentSender);
|
||||||
method public void fsync(@NonNull java.io.OutputStream) throws java.io.IOException;
|
method public void fsync(@NonNull java.io.OutputStream) throws java.io.IOException;
|
||||||
method @NonNull public int[] getChildSessionIds();
|
method @NonNull public int[] getChildSessionIds();
|
||||||
method @Nullable public android.content.pm.DataLoaderParams getDataLoaderParams();
|
|
||||||
method @NonNull public String[] getNames() throws java.io.IOException;
|
method @NonNull public String[] getNames() throws java.io.IOException;
|
||||||
method public int getParentSessionId();
|
method public int getParentSessionId();
|
||||||
method public boolean isMultiPackage();
|
method public boolean isMultiPackage();
|
||||||
@@ -12372,7 +12348,6 @@ package android.content.pm {
|
|||||||
method @NonNull public java.io.InputStream openRead(@NonNull String) throws java.io.IOException;
|
method @NonNull public java.io.InputStream openRead(@NonNull String) throws java.io.IOException;
|
||||||
method @NonNull public java.io.OutputStream openWrite(@NonNull String, long, long) throws java.io.IOException;
|
method @NonNull public java.io.OutputStream openWrite(@NonNull String, long, long) throws java.io.IOException;
|
||||||
method public void removeChildSessionId(int);
|
method public void removeChildSessionId(int);
|
||||||
method public void removeFile(int, @NonNull String);
|
|
||||||
method public void removeSplit(@NonNull String) throws java.io.IOException;
|
method public void removeSplit(@NonNull String) throws java.io.IOException;
|
||||||
method @Deprecated public void setChecksums(@NonNull String, @NonNull java.util.List<android.content.pm.Checksum>, @Nullable byte[]) throws java.io.IOException;
|
method @Deprecated public void setChecksums(@NonNull String, @NonNull java.util.List<android.content.pm.Checksum>, @Nullable byte[]) throws java.io.IOException;
|
||||||
method public void setStagingProgress(float);
|
method public void setStagingProgress(float);
|
||||||
@@ -12443,7 +12418,6 @@ package android.content.pm {
|
|||||||
method public void setAppLabel(@Nullable CharSequence);
|
method public void setAppLabel(@Nullable CharSequence);
|
||||||
method public void setAppPackageName(@Nullable String);
|
method public void setAppPackageName(@Nullable String);
|
||||||
method @Deprecated public void setAutoRevokePermissionsMode(boolean);
|
method @Deprecated public void setAutoRevokePermissionsMode(boolean);
|
||||||
method public void setDataLoaderParams(@NonNull android.content.pm.DataLoaderParams);
|
|
||||||
method public void setInstallLocation(int);
|
method public void setInstallLocation(int);
|
||||||
method public void setInstallReason(int);
|
method public void setInstallReason(int);
|
||||||
method public void setInstallScenario(int);
|
method public void setInstallScenario(int);
|
||||||
@@ -38369,25 +38343,6 @@ package android.service.controls.templates {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package android.service.dataloader {
|
|
||||||
|
|
||||||
public abstract class DataLoaderService extends android.app.Service {
|
|
||||||
ctor public DataLoaderService();
|
|
||||||
method @NonNull public final android.os.IBinder onBind(@NonNull android.content.Intent);
|
|
||||||
method @Nullable public android.service.dataloader.DataLoaderService.DataLoader onCreateDataLoader(@NonNull android.content.pm.DataLoaderParams);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static interface DataLoaderService.DataLoader {
|
|
||||||
method public boolean onCreate(@NonNull android.content.pm.DataLoaderParams, @NonNull android.service.dataloader.DataLoaderService.FileSystemConnector);
|
|
||||||
method public boolean onPrepareImage(@NonNull java.util.Collection<android.content.pm.InstallationFile>, @NonNull java.util.Collection<java.lang.String>);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final class DataLoaderService.FileSystemConnector {
|
|
||||||
method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void writeData(@NonNull String, long, long, @NonNull android.os.ParcelFileDescriptor) throws java.io.IOException;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
package android.service.dreams {
|
package android.service.dreams {
|
||||||
|
|
||||||
public class DreamService extends android.app.Service implements android.view.Window.Callback {
|
public class DreamService extends android.app.Service implements android.view.Window.Callback {
|
||||||
|
|||||||
@@ -2527,6 +2527,18 @@ package android.content.pm {
|
|||||||
|
|
||||||
public class DataLoaderParams {
|
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 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();
|
||||||
|
method @Nullable public byte[] getMetadata();
|
||||||
|
method @NonNull public String getName();
|
||||||
|
method @Nullable public byte[] getSignature();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class InstantAppInfo implements android.os.Parcelable {
|
public final class InstantAppInfo implements android.os.Parcelable {
|
||||||
@@ -2620,10 +2632,19 @@ package android.content.pm {
|
|||||||
public class PackageInstaller {
|
public class PackageInstaller {
|
||||||
method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean);
|
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_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 {
|
public static class PackageInstaller.Session implements java.io.Closeable {
|
||||||
|
method @RequiresPermission("com.android.permission.USE_INSTALLER_V2") 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 @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void commitTransferred(@NonNull android.content.IntentSender);
|
||||||
|
method @Nullable @RequiresPermission("com.android.permission.USE_INSTALLER_V2") public android.content.pm.DataLoaderParams getDataLoaderParams();
|
||||||
|
method @RequiresPermission("com.android.permission.USE_INSTALLER_V2") public void removeFile(int, @NonNull String);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PackageInstaller.SessionInfo implements android.os.Parcelable {
|
public static class PackageInstaller.SessionInfo implements android.os.Parcelable {
|
||||||
@@ -2644,6 +2665,7 @@ package android.content.pm {
|
|||||||
public static class PackageInstaller.SessionParams implements android.os.Parcelable {
|
public static class PackageInstaller.SessionParams implements android.os.Parcelable {
|
||||||
method @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public void setAllocateAggressive(boolean);
|
method @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public void setAllocateAggressive(boolean);
|
||||||
method @Deprecated public void setAllowDowngrade(boolean);
|
method @Deprecated public void setAllowDowngrade(boolean);
|
||||||
|
method @RequiresPermission(allOf={android.Manifest.permission.INSTALL_PACKAGES, "com.android.permission.USE_INSTALLER_V2"}) public void setDataLoaderParams(@NonNull android.content.pm.DataLoaderParams);
|
||||||
method public void setDontKillApp(boolean);
|
method public void setDontKillApp(boolean);
|
||||||
method public void setEnableRollback(boolean);
|
method public void setEnableRollback(boolean);
|
||||||
method public void setEnableRollback(boolean, int);
|
method public void setEnableRollback(boolean, int);
|
||||||
@@ -9815,6 +9837,24 @@ package android.service.contentsuggestions {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
package android.service.dataloader {
|
||||||
|
|
||||||
|
public abstract class DataLoaderService extends android.app.Service {
|
||||||
|
ctor public DataLoaderService();
|
||||||
|
method @Nullable public android.service.dataloader.DataLoaderService.DataLoader onCreateDataLoader(@NonNull android.content.pm.DataLoaderParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static interface DataLoaderService.DataLoader {
|
||||||
|
method public boolean onCreate(@NonNull android.content.pm.DataLoaderParams, @NonNull android.service.dataloader.DataLoaderService.FileSystemConnector);
|
||||||
|
method public boolean onPrepareImage(@NonNull java.util.Collection<android.content.pm.InstallationFile>, @NonNull java.util.Collection<java.lang.String>);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final class DataLoaderService.FileSystemConnector {
|
||||||
|
method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void writeData(@NonNull String, long, long, @NonNull android.os.ParcelFileDescriptor) throws java.io.IOException;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
package android.service.displayhash {
|
package android.service.displayhash {
|
||||||
|
|
||||||
public final class DisplayHashParams implements android.os.Parcelable {
|
public final class DisplayHashParams implements android.os.Parcelable {
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ import android.content.ComponentName;
|
|||||||
* This class represents the parameters used to configure a DataLoader.
|
* This class represents the parameters used to configure a DataLoader.
|
||||||
*
|
*
|
||||||
* {@see android.service.dataloader.DataLoaderService.DataLoader}
|
* {@see android.service.dataloader.DataLoaderService.DataLoader}
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public class DataLoaderParams {
|
public class DataLoaderParams {
|
||||||
@NonNull
|
@NonNull
|
||||||
private final DataLoaderParamsParcel mData;
|
private final DataLoaderParamsParcel mData;
|
||||||
|
|||||||
@@ -18,16 +18,18 @@ package android.content.pm;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.annotation.SystemApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Definition of a file in a streaming installation session.
|
* Definition of a file in a streaming installation session.
|
||||||
* You can use this class to retrieve the information of such a file, such as its name, size and
|
* You can use this class to retrieve the information of such a file, such as its name, size and
|
||||||
* metadata. These file attributes will be consistent with those used in:
|
* metadata. These file attributes will be consistent with those used in:
|
||||||
* {@code android.content.pm.PackageInstaller.Session#addFile}, when the file was first added
|
* {@code PackageInstaller.Session#addFile}, when the file was first added into the session.
|
||||||
* into the session.
|
|
||||||
*
|
*
|
||||||
* @see android.content.pm.PackageInstaller.Session#addFile
|
* @see android.content.pm.PackageInstaller.Session#addFile
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public final class InstallationFile {
|
public final class InstallationFile {
|
||||||
private final @NonNull InstallationFileParcel mParcel;
|
private final @NonNull InstallationFileParcel mParcel;
|
||||||
|
|
||||||
|
|||||||
@@ -229,12 +229,15 @@ public class PackageInstaller {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of DataLoader for this session. Will be one of
|
* Type of DataLoader for this session. Will be one of
|
||||||
* {@link #DATA_LOADER_TYPE_NONE}, {@link #DATA_LOADER_TYPE_STREAMING}.
|
* {@link #DATA_LOADER_TYPE_NONE}, {@link #DATA_LOADER_TYPE_STREAMING},
|
||||||
|
* {@link #DATA_LOADER_TYPE_INCREMENTAL}.
|
||||||
* <p>
|
* <p>
|
||||||
* See the individual types documentation for details.
|
* See the individual types documentation for details.
|
||||||
*
|
*
|
||||||
* @see Intent#getIntExtra(String, int)
|
* @see Intent#getIntExtra(String, int)
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public static final String EXTRA_DATA_LOADER_TYPE = "android.content.pm.extra.DATA_LOADER_TYPE";
|
public static final String EXTRA_DATA_LOADER_TYPE = "android.content.pm.extra.DATA_LOADER_TYPE";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -242,6 +245,7 @@ public class PackageInstaller {
|
|||||||
* Caller should make sure DataLoader is able to prepare image and reinitiate the operation.
|
* Caller should make sure DataLoader is able to prepare image and reinitiate the operation.
|
||||||
*
|
*
|
||||||
* @see #EXTRA_SESSION_ID
|
* @see #EXTRA_SESSION_ID
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
public static final int STATUS_PENDING_STREAMING = -2;
|
public static final int STATUS_PENDING_STREAMING = -2;
|
||||||
|
|
||||||
@@ -344,21 +348,25 @@ public class PackageInstaller {
|
|||||||
* Default value, non-streaming installation session.
|
* Default value, non-streaming installation session.
|
||||||
*
|
*
|
||||||
* @see #EXTRA_DATA_LOADER_TYPE
|
* @see #EXTRA_DATA_LOADER_TYPE
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public static final int DATA_LOADER_TYPE_NONE = DataLoaderType.NONE;
|
public static final int DATA_LOADER_TYPE_NONE = DataLoaderType.NONE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Streaming installation using data loader.
|
* Streaming installation using data loader.
|
||||||
*
|
*
|
||||||
* @see #EXTRA_DATA_LOADER_TYPE
|
* @see #EXTRA_DATA_LOADER_TYPE
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public static final int DATA_LOADER_TYPE_STREAMING = DataLoaderType.STREAMING;
|
public static final int DATA_LOADER_TYPE_STREAMING = DataLoaderType.STREAMING;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Streaming installation using Incremental FileSystem.
|
* Streaming installation using Incremental FileSystem.
|
||||||
*
|
*
|
||||||
* @see #EXTRA_DATA_LOADER_TYPE
|
* @see #EXTRA_DATA_LOADER_TYPE
|
||||||
* @hide
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
public static final int DATA_LOADER_TYPE_INCREMENTAL = DataLoaderType.INCREMENTAL;
|
public static final int DATA_LOADER_TYPE_INCREMENTAL = DataLoaderType.INCREMENTAL;
|
||||||
@@ -366,13 +374,18 @@ public class PackageInstaller {
|
|||||||
/**
|
/**
|
||||||
* Target location for the file in installation session is /data/app/<packageName>-<id>.
|
* Target location for the file in installation session is /data/app/<packageName>-<id>.
|
||||||
* This is the intended location for APKs.
|
* This is the intended location for APKs.
|
||||||
|
* Requires permission to install packages.
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public static final int LOCATION_DATA_APP = InstallationFileLocation.DATA_APP;
|
public static final int LOCATION_DATA_APP = InstallationFileLocation.DATA_APP;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Target location for the file in installation session is
|
* Target location for the file in installation session is
|
||||||
* /data/media/<userid>/Android/obb/<packageName>. This is the intended location for OBBs.
|
* /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;
|
public static final int LOCATION_MEDIA_OBB = InstallationFileLocation.MEDIA_OBB;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -380,7 +393,9 @@ public class PackageInstaller {
|
|||||||
* /data/media/<userid>/Android/data/<packageName>.
|
* /data/media/<userid>/Android/data/<packageName>.
|
||||||
* This is the intended location for application data.
|
* This is the intended location for application data.
|
||||||
* Can only be used by an app itself running under specific user.
|
* Can only be used by an app itself running under specific user.
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public static final int LOCATION_MEDIA_DATA = InstallationFileLocation.MEDIA_DATA;
|
public static final int LOCATION_MEDIA_DATA = InstallationFileLocation.MEDIA_DATA;
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@@ -1152,7 +1167,10 @@ public class PackageInstaller {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return data loader params or null if the session is not using one.
|
* @return data loader params or null if the session is not using one.
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
|
@RequiresPermission(android.Manifest.permission.USE_INSTALLER_V2)
|
||||||
public @Nullable DataLoaderParams getDataLoaderParams() {
|
public @Nullable DataLoaderParams getDataLoaderParams() {
|
||||||
try {
|
try {
|
||||||
DataLoaderParamsParcel data = mSession.getDataLoaderParams();
|
DataLoaderParamsParcel data = mSession.getDataLoaderParams();
|
||||||
@@ -1189,7 +1207,11 @@ public class PackageInstaller {
|
|||||||
* @throws IllegalStateException if called for non-streaming session
|
* @throws IllegalStateException if called for non-streaming session
|
||||||
*
|
*
|
||||||
* @see android.content.pm.InstallationFile
|
* @see android.content.pm.InstallationFile
|
||||||
|
*
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
|
@RequiresPermission(android.Manifest.permission.USE_INSTALLER_V2)
|
||||||
public void addFile(@FileLocation int location, @NonNull String name, long lengthBytes,
|
public void addFile(@FileLocation int location, @NonNull String name, long lengthBytes,
|
||||||
@NonNull byte[] metadata, @Nullable byte[] signature) {
|
@NonNull byte[] metadata, @Nullable byte[] signature) {
|
||||||
try {
|
try {
|
||||||
@@ -1209,8 +1231,11 @@ public class PackageInstaller {
|
|||||||
* @param name name of a file, e.g. split.
|
* @param name name of a file, e.g. split.
|
||||||
* @throws SecurityException if called after the session has been
|
* @throws SecurityException if called after the session has been
|
||||||
* sealed or abandoned
|
* sealed or abandoned
|
||||||
* @throws IllegalStateException if called for non-streaming session
|
* @throws IllegalStateException if called for non-DataLoader session
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
|
@RequiresPermission(android.Manifest.permission.USE_INSTALLER_V2)
|
||||||
public void removeFile(@FileLocation int location, @NonNull String name) {
|
public void removeFile(@FileLocation int location, @NonNull String name) {
|
||||||
try {
|
try {
|
||||||
mSession.removeFile(location, name);
|
mSession.removeFile(location, name);
|
||||||
@@ -2026,7 +2051,13 @@ public class PackageInstaller {
|
|||||||
* staging folder.
|
* staging folder.
|
||||||
*
|
*
|
||||||
* @see android.service.dataloader.DataLoaderService.DataLoader
|
* @see android.service.dataloader.DataLoaderService.DataLoader
|
||||||
|
*
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
|
@RequiresPermission(allOf = {
|
||||||
|
Manifest.permission.INSTALL_PACKAGES,
|
||||||
|
Manifest.permission.USE_INSTALLER_V2})
|
||||||
public void setDataLoaderParams(@NonNull DataLoaderParams dataLoaderParams) {
|
public void setDataLoaderParams(@NonNull DataLoaderParams dataLoaderParams) {
|
||||||
this.dataLoaderParams = dataLoaderParams;
|
this.dataLoaderParams = dataLoaderParams;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package android.service.dataloader;
|
|||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.annotation.RequiresPermission;
|
import android.annotation.RequiresPermission;
|
||||||
|
import android.annotation.SystemApi;
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.DataLoaderParams;
|
import android.content.pm.DataLoaderParams;
|
||||||
@@ -48,14 +49,19 @@ import java.util.Collection;
|
|||||||
*
|
*
|
||||||
* @see android.content.pm.DataLoaderParams
|
* @see android.content.pm.DataLoaderParams
|
||||||
* @see android.content.pm.PackageInstaller.SessionParams#setDataLoaderParams
|
* @see android.content.pm.PackageInstaller.SessionParams#setDataLoaderParams
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public abstract class DataLoaderService extends Service {
|
public abstract class DataLoaderService extends Service {
|
||||||
private static final String TAG = "DataLoaderService";
|
private static final String TAG = "DataLoaderService";
|
||||||
private final DataLoaderBinderService mBinder = new DataLoaderBinderService();
|
private final DataLoaderBinderService mBinder = new DataLoaderBinderService();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DataLoader interface. Each instance corresponds to a single installation session.
|
* DataLoader interface. Each instance corresponds to a single installation session.
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public interface DataLoader {
|
public interface DataLoader {
|
||||||
/**
|
/**
|
||||||
* A virtual constructor.
|
* A virtual constructor.
|
||||||
@@ -112,7 +118,9 @@ public abstract class DataLoaderService extends Service {
|
|||||||
/**
|
/**
|
||||||
* DataLoader factory method.
|
* DataLoader factory method.
|
||||||
* An installation session uses it to create an instance of DataLoader.
|
* An installation session uses it to create an instance of DataLoader.
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public @Nullable DataLoader onCreateDataLoader(@NonNull DataLoaderParams dataLoaderParams) {
|
public @Nullable DataLoader onCreateDataLoader(@NonNull DataLoaderParams dataLoaderParams) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -178,7 +186,10 @@ public abstract class DataLoaderService extends Service {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides access to the installation image.
|
* Provides access to the installation image.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
public static final class FileSystemConnector {
|
public static final class FileSystemConnector {
|
||||||
/**
|
/**
|
||||||
* Create a wrapper for a native instance.
|
* Create a wrapper for a native instance.
|
||||||
|
|||||||
@@ -4099,6 +4099,15 @@
|
|||||||
<permission android:name="com.android.permission.INSTALL_EXISTING_PACKAGES"
|
<permission android:name="com.android.permission.INSTALL_EXISTING_PACKAGES"
|
||||||
android:protectionLevel="signature|privileged" />
|
android:protectionLevel="signature|privileged" />
|
||||||
|
|
||||||
|
<!-- Allows an application to use the package installer v2 APIs.
|
||||||
|
<p>The package installer v2 APIs are still a work in progress and we're
|
||||||
|
currently validating they work in all scenarios.
|
||||||
|
<p>Not for use by third-party applications.
|
||||||
|
@hide
|
||||||
|
-->
|
||||||
|
<permission android:name="com.android.permission.USE_INSTALLER_V2"
|
||||||
|
android:protectionLevel="signature|installer" />
|
||||||
|
|
||||||
<!-- Allows an application to use System Data Loaders.
|
<!-- Allows an application to use System Data Loaders.
|
||||||
<p>Not for use by third-party applications.
|
<p>Not for use by third-party applications.
|
||||||
@hide
|
@hide
|
||||||
|
|||||||
@@ -417,6 +417,8 @@ applications that come with the platform
|
|||||||
<permission name="android.permission.SET_WALLPAPER" />
|
<permission name="android.permission.SET_WALLPAPER" />
|
||||||
<permission name="android.permission.SET_WALLPAPER_COMPONENT" />
|
<permission name="android.permission.SET_WALLPAPER_COMPONENT" />
|
||||||
<permission name="android.permission.REQUEST_NOTIFICATION_ASSISTANT_SERVICE" />
|
<permission name="android.permission.REQUEST_NOTIFICATION_ASSISTANT_SERVICE" />
|
||||||
|
<!-- Permissions required for Incremental CTS tests -->
|
||||||
|
<permission name="com.android.permission.USE_INSTALLER_V2"/>
|
||||||
<permission name="android.permission.LOADER_USAGE_STATS"/>
|
<permission name="android.permission.LOADER_USAGE_STATS"/>
|
||||||
<!-- Permission required to test system only camera devices. -->
|
<!-- Permission required to test system only camera devices. -->
|
||||||
<permission name="android.permission.SYSTEM_CAMERA" />
|
<permission name="android.permission.SYSTEM_CAMERA" />
|
||||||
|
|||||||
@@ -162,6 +162,7 @@
|
|||||||
<uses-permission android:name="android.permission.READ_INPUT_STATE" />
|
<uses-permission android:name="android.permission.READ_INPUT_STATE" />
|
||||||
<uses-permission android:name="android.permission.SET_ORIENTATION" />
|
<uses-permission android:name="android.permission.SET_ORIENTATION" />
|
||||||
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
|
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
|
||||||
|
<uses-permission android:name="com.android.permission.USE_INSTALLER_V2" />
|
||||||
<uses-permission android:name="com.android.permission.USE_SYSTEM_DATA_LOADERS" />
|
<uses-permission android:name="com.android.permission.USE_SYSTEM_DATA_LOADERS" />
|
||||||
<uses-permission android:name="android.permission.MOVE_PACKAGE" />
|
<uses-permission android:name="android.permission.MOVE_PACKAGE" />
|
||||||
<uses-permission android:name="android.permission.KEEP_UNINSTALLED_PACKAGES" />
|
<uses-permission android:name="android.permission.KEEP_UNINSTALLED_PACKAGES" />
|
||||||
|
|||||||
@@ -527,6 +527,14 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
|
|||||||
throw new SecurityException("User restriction prevents installing");
|
throw new SecurityException("User restriction prevents installing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params.dataLoaderParams != null
|
||||||
|
&& mContext.checkCallingOrSelfPermission(Manifest.permission.USE_INSTALLER_V2)
|
||||||
|
!= PackageManager.PERMISSION_GRANTED) {
|
||||||
|
throw new SecurityException("You need the "
|
||||||
|
+ "com.android.permission.USE_INSTALLER_V2 permission "
|
||||||
|
+ "to use a data loader");
|
||||||
|
}
|
||||||
|
|
||||||
// INSTALL_REASON_ROLLBACK allows an app to be rolled back without requiring the ROLLBACK
|
// INSTALL_REASON_ROLLBACK allows an app to be rolled back without requiring the ROLLBACK
|
||||||
// capability; ensure if this is set as the install reason the app has one of the necessary
|
// capability; ensure if this is set as the install reason the app has one of the necessary
|
||||||
// signature permissions to perform the rollback.
|
// signature permissions to perform the rollback.
|
||||||
|
|||||||
@@ -3636,12 +3636,14 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataLoaderParamsParcel getDataLoaderParams() {
|
public DataLoaderParamsParcel getDataLoaderParams() {
|
||||||
|
mContext.enforceCallingOrSelfPermission(Manifest.permission.USE_INSTALLER_V2, null);
|
||||||
return params.dataLoaderParams != null ? params.dataLoaderParams.getData() : null;
|
return params.dataLoaderParams != null ? params.dataLoaderParams.getData() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addFile(int location, String name, long lengthBytes, byte[] metadata,
|
public void addFile(int location, String name, long lengthBytes, byte[] metadata,
|
||||||
byte[] signature) {
|
byte[] signature) {
|
||||||
|
mContext.enforceCallingOrSelfPermission(Manifest.permission.USE_INSTALLER_V2, null);
|
||||||
if (!isDataLoaderInstallation()) {
|
if (!isDataLoaderInstallation()) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Cannot add files to non-data loader installation session.");
|
"Cannot add files to non-data loader installation session.");
|
||||||
@@ -3674,6 +3676,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeFile(int location, String name) {
|
public void removeFile(int location, String name) {
|
||||||
|
mContext.enforceCallingOrSelfPermission(Manifest.permission.USE_INSTALLER_V2, null);
|
||||||
if (!isDataLoaderInstallation()) {
|
if (!isDataLoaderInstallation()) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Cannot add files to non-data loader installation session.");
|
"Cannot add files to non-data loader installation session.");
|
||||||
|
|||||||
Reference in New Issue
Block a user