summaryrefslogtreecommitdiffstats
path: root/libs/storage
diff options
context:
space:
mode:
authorJason parks <jparks@google.com>2011-01-07 09:01:15 -0600
committerJason parks <jparks@google.com>2011-01-07 09:01:56 -0600
commitd6332552761fcce700adb465ff540d30a671403c (patch)
treeb476c74c4e0872f9bf0531797da06a69c745de2f /libs/storage
parenta085ef3e35e986463567360b1d02a66c642ea603 (diff)
downloadframeworks_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.cpp20
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");