From d6332552761fcce700adb465ff540d30a671403c Mon Sep 17 00:00:00 2001 From: Jason parks Date: Fri, 7 Jan 2011 09:01:15 -0600 Subject: Add a method enable encryption. This is for testing and needs to be cleaned up. Change-Id: I71cd5412f7096dc13d9ab61229ee9846c6f0006a --- libs/storage/IMountService.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'libs/storage/IMountService.cpp') diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp index a7ab8242fe87..7fbf67a02764 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 @@ -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"); -- cgit v1.2.3