summaryrefslogtreecommitdiff
path: root/libs/storage/IMountService.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/storage/IMountService.cpp')
-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 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<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");