diff options
author | Jason parks <jparks@google.com> | 2011-01-07 09:01:15 -0600 |
---|---|---|
committer | Jason parks <jparks@google.com> | 2011-01-07 09:01:56 -0600 |
commit | d6332552761fcce700adb465ff540d30a671403c (patch) | |
tree | b476c74c4e0872f9bf0531797da06a69c745de2f /core/java | |
parent | a085ef3e35e986463567360b1d02a66c642ea603 (diff) | |
download | frameworks_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.java | 32 |
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; } |