summaryrefslogtreecommitdiffstats
path: root/core/java/android/os/storage/IMountService.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2014-08-20 16:26:32 -0700
committerJeff Sharkey <jsharkey@android.com>2014-08-22 16:25:04 -0700
commit941a8ba1a6043cf84a7bf622e44a0b4f7abd0178 (patch)
treec783987f68caaa4cc827b3c720f269bcc9d34667 /core/java/android/os/storage/IMountService.java
parent7653a30ea0232ab8323ec51ddcba8d8054ca8a2f (diff)
downloadframeworks_base-941a8ba1a6043cf84a7bf622e44a0b4f7abd0178.zip
frameworks_base-941a8ba1a6043cf84a7bf622e44a0b4f7abd0178.tar.gz
frameworks_base-941a8ba1a6043cf84a7bf622e44a0b4f7abd0178.tar.bz2
Installing splits into ASECs!
Sessions can now zero-copy data directly into pre-allocated ASEC containers. Then at commit time, we compute the total size of the final app, including any inherited APKs and unpacked libraries, and resize the container in one step. This supports both brand new ASEC installs and inheriting from existing ASEC installs. To keep things simple, it currently requires copying any inherited ASEC contents, but this could be optimized in the future. Expose new vold resize command, and allow read-write mounting of ASEC containers. Move native library extraction into the installer flow, since it needs to happen before ASEC is sealed. Move multiArch flag into NativeLibraryHelper, instead of making everyone pass it around. Migrate size calculation to shared location. Separate "other" package name in public API, provide a path to a storage device when relevant, and add more docs. Bug: 16514385 Change-Id: I06c6ce588d312ee7e64cce02733895d640b88456
Diffstat (limited to 'core/java/android/os/storage/IMountService.java')
-rw-r--r--core/java/android/os/storage/IMountService.java48
1 files changed, 45 insertions, 3 deletions
diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java
index 939cda9..d1fadd6 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;
}