summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorJason parks <jparks@google.com>2011-01-07 09:01:15 -0600
committerJason parks <jparks@google.com>2011-01-07 09:01:56 -0600
commitd6332552761fcce700adb465ff540d30a671403c (patch)
treeb476c74c4e0872f9bf0531797da06a69c745de2f /core/java
parenta085ef3e35e986463567360b1d02a66c642ea603 (diff)
downloadframeworks_base-d6332552761fcce700adb465ff540d30a671403c.zip
frameworks_base-d6332552761fcce700adb465ff540d30a671403c.tar.gz
frameworks_base-d6332552761fcce700adb465ff540d30a671403c.tar.bz2
Add a method enable encryption.
This is for testing and needs to be cleaned up. Change-Id: I71cd5412f7096dc13d9ab61229ee9846c6f0006a
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/storage/IMountService.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java
index 23ed31f..b9d4711 100644
--- a/core/java/android/os/storage/IMountService.java
+++ b/core/java/android/os/storage/IMountService.java
@@ -603,6 +603,23 @@ public interface IMountService extends IInterface {
}
return _result;
}
+
+ public int encryptStorage(String password) throws RemoteException {
+ Parcel _data = Parcel.obtain();
+ Parcel _reply = Parcel.obtain();
+ int _result;
+ try {
+ _data.writeInterfaceToken(DESCRIPTOR);
+ _data.writeString(password);
+ mRemote.transact(Stub.TRANSACTION_encryptStorage, _data, _reply, 0);
+ _reply.readException();
+ _result = _reply.readInt();
+ } finally {
+ _reply.recycle();
+ _data.recycle();
+ }
+ return _result;
+ }
}
private static final String DESCRIPTOR = "IMountService";
@@ -661,6 +678,8 @@ public interface IMountService extends IInterface {
static final int TRANSACTION_decryptStorage = IBinder.FIRST_CALL_TRANSACTION + 26;
+ static final int TRANSACTION_encryptStorage = IBinder.FIRST_CALL_TRANSACTION + 27;
+
/**
* Cast an IBinder object into an IMountService interface, generating a
* proxy if needed.
@@ -950,6 +969,14 @@ public interface IMountService extends IInterface {
reply.writeInt(result);
return true;
}
+ case TRANSACTION_encryptStorage: {
+ data.enforceInterface(DESCRIPTOR);
+ String password = data.readString();
+ int result = encryptStorage(password);
+ reply.writeNoException();
+ reply.writeInt(result);
+ return true;
+ }
}
return super.onTransact(code, data, reply, flags);
}
@@ -1114,4 +1141,9 @@ public interface IMountService extends IInterface {
* Decrypts any encrypted volumes.
*/
public int decryptStorage(String password) throws RemoteException;
+
+ /**
+ * Encrypts storage.
+ */
+ public int encryptStorage(String password) throws RemoteException;
}