diff options
| author | Jason parks <jparks@google.com> | 2011-01-13 07:41:53 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-13 07:41:53 -0800 |
| commit | 21f62b9e461416ae61c8471f7199f104f8fe33de (patch) | |
| tree | bfb5396ee263d8ea97bf4934cbced60a38b2bd2d /core/java | |
| parent | ca6777b23bbe9283380efb2ba7e6d0a79d8669db (diff) | |
| parent | 56aa5321fe6f00fa3662e6f46a4b2559aa34f63e (diff) | |
Merge "Add a method enable encryption." into honeycomb
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 23ed31f780fd..b9d47117bc8d 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; } |
