diff options
author | Jason parks <jparks@google.com> | 2010-11-29 09:05:25 -0600 |
---|---|---|
committer | Jason parks <jparks@google.com> | 2011-01-05 12:32:49 -0600 |
commit | 5af0b916f850486cff4797355bf9e7dc3352fe00 (patch) | |
tree | 596919e498d72eadbc42b3307ac4f81542d34746 /libs/storage | |
parent | cf7775a88f8c88fc3a902799fc1d5100f6f7e0d6 (diff) |
Add decryption support to MountService.
* Implement the decryptStorage() method on the Mount Service.
This method makes the calls into vold to decrypt the encrypted
volumes and mount them.
Change-Id: I4f6e07a111cf0b36611d590debf9f6579c5ac5f7
Diffstat (limited to 'libs/storage')
-rw-r--r-- | libs/storage/IMountService.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp index b5f9c4750a29..a7ab8242fe87 100644 --- a/libs/storage/IMountService.cpp +++ b/libs/storage/IMountService.cpp @@ -48,6 +48,7 @@ enum { TRANSACTION_isObbMounted, TRANSACTION_getMountedObbPath, TRANSACTION_isExternalStorageEmulated, + TRANSACTION_decryptStorage, }; class BpMountService: public BpInterface<IMountService> @@ -504,6 +505,23 @@ public: path = reply.readString16(); return true; } + + int32_t decryptStorage(const String16& password) + { + Parcel data, reply; + data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); + data.writeString16(password); + if (remote()->transact(TRANSACTION_decryptStorage, data, &reply) != NO_ERROR) { + LOGD("decryptStorage could not contact remote\n"); + return -1; + } + int32_t err = reply.readExceptionCode(); + if (err < 0) { + LOGD("decryptStorage caught exception %d\n", err); + return err; + } + return reply.readInt32(); + } }; IMPLEMENT_META_INTERFACE(MountService, "IMountService"); |