diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2014-08-24 18:45:53 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-24 18:45:55 +0000 |
| commit | 37cf9907d201e39ecf8a8de934c44e3eaf04b6db (patch) | |
| tree | 2725375c21bcdb0d179d984d74ec3b28ca84e54d /core/java/android | |
| parent | da604cc1ec13cd0c6faf982b6dc9b69163664725 (diff) | |
| parent | 941a8ba1a6043cf84a7bf622e44a0b4f7abd0178 (diff) | |
Merge "Installing splits into ASECs!" into lmp-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/content/pm/PackageInstaller.java | 65 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageParser.java | 2 | ||||
| -rw-r--r-- | core/java/android/os/storage/IMountService.java | 48 |
3 files changed, 106 insertions, 9 deletions
diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java index 7419ebc83a31..9afdbf74cd58 100644 --- a/core/java/android/content/pm/PackageInstaller.java +++ b/core/java/android/content/pm/PackageInstaller.java @@ -45,6 +45,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.security.MessageDigest; import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -86,6 +87,8 @@ public class PackageInstaller { * <p> * In some cases, a matching Activity may not exist, so ensure you safeguard * against this. + * <p> + * The session to show details for is defined in {@link #EXTRA_SESSION_ID}. */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_SESSION_DETAILS = "android.content.pm.action.SESSION_DETAILS"; @@ -95,21 +98,57 @@ public class PackageInstaller { ACTION_CONFIRM_PERMISSIONS = "android.content.pm.action.CONFIRM_PERMISSIONS"; /** - * An integer session ID. + * An integer session ID that an operation is working with. * - * @see #ACTION_SESSION_DETAILS + * @see Intent#getIntExtra(String, int) */ public static final String EXTRA_SESSION_ID = "android.content.pm.extra.SESSION_ID"; + /** + * Package name that an operation is working with. + * + * @see Intent#getStringExtra(String) + */ + public static final String EXTRA_PACKAGE_NAME = "android.content.pm.extra.PACKAGE_NAME"; + + /** + * Current status of an operation. Will be one of + * {@link #STATUS_PENDING_USER_ACTION}, {@link #STATUS_SUCCESS}, + * {@link #STATUS_FAILURE}, {@link #STATUS_FAILURE_ABORTED}, + * {@link #STATUS_FAILURE_BLOCKED}, {@link #STATUS_FAILURE_CONFLICT}, + * {@link #STATUS_FAILURE_INCOMPATIBLE}, {@link #STATUS_FAILURE_INVALID}, or + * {@link #STATUS_FAILURE_STORAGE}. + * <p> + * More information about a status may be available through additional + * extras; see the individual status documentation for details. + * + * @see Intent#getIntExtra(String, int) + */ public static final String EXTRA_STATUS = "android.content.pm.extra.STATUS"; + + /** + * Detailed string representation of the status, including raw details that + * are useful for debugging. + * + * @see Intent#getStringExtra(String) + */ public static final String EXTRA_STATUS_MESSAGE = "android.content.pm.extra.STATUS_MESSAGE"; /** - * Package name relevant to a status. + * Another package name relevant to a status. This is typically the package + * responsible for causing an operation failure. * * @see Intent#getStringExtra(String) */ - public static final String EXTRA_PACKAGE_NAME = "android.content.pm.extra.PACKAGE_NAME"; + public static final String + EXTRA_OTHER_PACKAGE_NAME = "android.content.pm.extra.OTHER_PACKAGE_NAME"; + + /** + * Storage path relevant to a status. + * + * @see Intent#getStringExtra(String) + */ + public static final String EXTRA_STORAGE_PATH = "android.content.pm.extra.STORAGE_PATH"; /** {@hide} */ @Deprecated @@ -153,8 +192,12 @@ public class PackageInstaller { * The operation failed because it was blocked. For example, a device policy * may be blocking the operation, a package verifier may have blocked the * operation, or the app may be required for core system operation. + * <p> + * The result may also contain {@link #EXTRA_OTHER_PACKAGE_NAME} with the + * specific package blocking the install. * * @see #EXTRA_STATUS_MESSAGE + * @see #EXTRA_OTHER_PACKAGE_NAME */ public static final int STATUS_FAILURE_BLOCKED = 2; @@ -182,10 +225,11 @@ public class PackageInstaller { * permission, incompatible certificates, etc. The user may be able to * uninstall another app to fix the issue. * <p> - * The result may also contain {@link #EXTRA_PACKAGE_NAME} with the + * The result may also contain {@link #EXTRA_OTHER_PACKAGE_NAME} with the * specific package identified as the cause of the conflict. * * @see #EXTRA_STATUS_MESSAGE + * @see #EXTRA_OTHER_PACKAGE_NAME */ public static final int STATUS_FAILURE_CONFLICT = 5; @@ -193,8 +237,12 @@ public class PackageInstaller { * The operation failed because of storage issues. For example, the device * may be running low on space, or external media may be unavailable. The * user may be able to help free space or insert different external media. + * <p> + * The result may also contain {@link #EXTRA_STORAGE_PATH} with the path to + * the storage device that caused the failure. * * @see #EXTRA_STATUS_MESSAGE + * @see #EXTRA_STORAGE_PATH */ public static final int STATUS_FAILURE_STORAGE = 6; @@ -281,6 +329,13 @@ public class PackageInstaller { * To succeed, the caller must be the current home app. */ public @NonNull List<SessionInfo> getAllSessions() { + final ApplicationInfo info = mContext.getApplicationInfo(); + if ("com.google.android.googlequicksearchbox".equals(info.packageName) + && info.versionCode <= 300400070) { + Log.d(TAG, "Ignoring callback request from old prebuilt"); + return Collections.EMPTY_LIST; + } + try { return mInstaller.getAllSessions(mUserId); } catch (RemoteException e) { diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index eb8b7628160f..142206abf6e7 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -264,7 +264,7 @@ public class PackageParser { public final boolean coreApp; public final boolean multiArch; - private PackageLite(String codePath, ApkLite baseApk, String[] splitNames, + public PackageLite(String codePath, ApkLite baseApk, String[] splitNames, String[] splitCodePaths) { this.packageName = baseApk.packageName; this.versionCode = baseApk.versionCode; diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java index 939cda902753..d1fadd67716b 100644 --- a/core/java/android/os/storage/IMountService.java +++ b/core/java/android/os/storage/IMountService.java @@ -321,7 +321,7 @@ public interface IMountService extends IInterface { * Mount a secure container with the specified key and owner UID. * Returns an int consistent with MountServiceResultCode */ - public int mountSecureContainer(String id, String key, int ownerUid) + public int mountSecureContainer(String id, String key, int ownerUid, boolean readOnly) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); @@ -331,6 +331,7 @@ public interface IMountService extends IInterface { _data.writeString(id); _data.writeString(key); _data.writeInt(ownerUid); + _data.writeInt(readOnly ? 1 : 0); mRemote.transact(Stub.TRANSACTION_mountSecureContainer, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); @@ -834,6 +835,27 @@ public interface IMountService extends IInterface { } return _result; } + + @Override + public int resizeSecureContainer(String id, int sizeMb, String key) + throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(id); + _data.writeInt(sizeMb); + _data.writeString(key); + mRemote.transact(Stub.TRANSACTION_resizeSecureContainer, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } } private static final String DESCRIPTOR = "IMountService"; @@ -918,6 +940,8 @@ public interface IMountService extends IInterface { static final int TRANSACTION_getField = IBinder.FIRST_CALL_TRANSACTION + 39; + static final int TRANSACTION_resizeSecureContainer = IBinder.FIRST_CALL_TRANSACTION + 40; + /** * Cast an IBinder object into an IMountService interface, generating a * proxy if needed. @@ -1082,7 +1106,9 @@ public interface IMountService extends IInterface { key = data.readString(); int ownerUid; ownerUid = data.readInt(); - int resultCode = mountSecureContainer(id, key, ownerUid); + boolean readOnly; + readOnly = data.readInt() != 0; + int resultCode = mountSecureContainer(id, key, ownerUid, readOnly); reply.writeNoException(); reply.writeInt(resultCode); return true; @@ -1308,6 +1334,19 @@ public interface IMountService extends IInterface { reply.writeString(contents); return true; } + case TRANSACTION_resizeSecureContainer: { + data.enforceInterface(DESCRIPTOR); + String id; + id = data.readString(); + int sizeMb; + sizeMb = data.readInt(); + String key; + key = data.readString(); + int resultCode = resizeSecureContainer(id, sizeMb, key); + reply.writeNoException(); + reply.writeInt(resultCode); + return true; + } } return super.onTransact(code, data, reply, flags); } @@ -1405,7 +1444,8 @@ public interface IMountService extends IInterface { * Mount a secure container with the specified key and owner UID. Returns an * int consistent with MountServiceResultCode */ - public int mountSecureContainer(String id, String key, int ownerUid) throws RemoteException; + public int mountSecureContainer(String id, String key, int ownerUid, boolean readOnly) + throws RemoteException; /** * Mount external storage at given mount point. Returns an int consistent @@ -1571,4 +1611,6 @@ public interface IMountService extends IInterface { * @return contents of field */ public String getField(String field) throws RemoteException; + + public int resizeSecureContainer(String id, int sizeMb, String key) throws RemoteException; } |
