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 /libs/storage | |
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 'libs/storage')
-rw-r--r-- | libs/storage/IMountService.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp index a7ab824..7fbf67a 100644 --- a/libs/storage/IMountService.cpp +++ b/libs/storage/IMountService.cpp @@ -49,6 +49,7 @@ enum { TRANSACTION_getMountedObbPath, TRANSACTION_isExternalStorageEmulated, TRANSACTION_decryptStorage, + TRANSACTION_encryptStorage, }; class BpMountService: public BpInterface<IMountService> @@ -505,7 +506,7 @@ public: path = reply.readString16(); return true; } - + int32_t decryptStorage(const String16& password) { Parcel data, reply; @@ -522,6 +523,23 @@ public: } return reply.readInt32(); } + + int32_t encryptStorage(const String16& password) + { + Parcel data, reply; + data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); + data.writeString16(password); + if (remote()->transact(TRANSACTION_encryptStorage, data, &reply) != NO_ERROR) { + LOGD("encryptStorage could not contact remote\n"); + return -1; + } + int32_t err = reply.readExceptionCode(); + if (err < 0) { + LOGD("encryptStorage caught exception %d\n", err); + return err; + } + return reply.readInt32(); + } }; IMPLEMENT_META_INTERFACE(MountService, "IMountService"); |