summaryrefslogtreecommitdiffstats
path: root/libs/storage
diff options
context:
space:
mode:
authorAmit Blay <ablay@codeaurora.org>2015-09-02 08:31:53 +0300
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:28:26 -0600
commit407e8a9b46e09b369cd1758ed1a55faffbd2df11 (patch)
treecd9f501868b38d45f06d982d9b56826fb83ee745 /libs/storage
parenteb4fa8cd3f2fa5a0181d4711e458d4e0e64c1ee1 (diff)
downloadframeworks_base-407e8a9b46e09b369cd1758ed1a55faffbd2df11.zip
frameworks_base-407e8a9b46e09b369cd1758ed1a55faffbd2df11.tar.gz
frameworks_base-407e8a9b46e09b369cd1758ed1a55faffbd2df11.tar.bz2
Added 'EncryptWipeStorage' API to MountService API
The EncryptWipeStorage API is used to create a new ext4 file system on the userdata partition, instead of the existing one, and encrypt it. This as opposed to the way EncryptStorage API works, which encrypts the existing file system as is ('inplace'). The 'wipe' option is already supported in the underlying Cryptfs implementation. Also in this change, new values that can be returned by 'getEncryptionState' API are declared. These values reflects the state of the MDTP activation, together with the general encryption state, in case that MDTP is activated. - ENCRYPTION_STATE_OK_MDTP_ACTIVATED - means that the crypto state is ok, and MDTP is activated. - ENCRYPTION_STATE_ERROR_MDTP_ACTIVATED - means that the crypto state is bad, and MDTP is activated. Change-Id: Ide628a8cf6499bc2216b08c22479a37133bebb03
Diffstat (limited to 'libs/storage')
-rw-r--r--libs/storage/IMountService.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp
index c643ed0..f7379b6 100644
--- a/libs/storage/IMountService.cpp
+++ b/libs/storage/IMountService.cpp
@@ -50,6 +50,7 @@ enum {
TRANSACTION_isExternalStorageEmulated,
TRANSACTION_decryptStorage,
TRANSACTION_encryptStorage,
+ TRANSACTION_encryptWipeStorage = IBinder::FIRST_CALL_TRANSACTION + 61,
};
class BpMountService: public BpInterface<IMountService>
@@ -551,6 +552,23 @@ public:
}
return reply.readInt32();
}
+
+ int32_t encryptWipeStorage(const String16& password)
+ {
+ Parcel data, reply;
+ data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
+ data.writeString16(password);
+ if (remote()->transact(TRANSACTION_encryptWipeStorage, data, &reply) != NO_ERROR) {
+ ALOGD("encryptWipeStorage could not contact remote\n");
+ return -1;
+ }
+ int32_t err = reply.readExceptionCode();
+ if (err < 0) {
+ ALOGD("encryptWipeStorage caught exception %d\n", err);
+ return err;
+ }
+ return reply.readInt32();
+ }
};
IMPLEMENT_META_INTERFACE(MountService, "IMountService")