Rename "user key" methods in vold
Rename methods that refer to "user key" to be more precise about what
they mean. For more details, see the corresponding frameworks/base
changes (I202ebbfd2b4f79fedb3ed120a8ad81500c126894 and
I5894beb97823dced5954e405d779fada49c79e8d).
No change in behavior except for some changed log messages.
Flag: exempt, mechanical refactoring only
Test: presubmit
Change-Id: I9edcb557172395f4f6cf8e837efcc06fcfefb37d
diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp
index d51652b..c39604b 100644
--- a/VoldNativeService.cpp
+++ b/VoldNativeService.cpp
@@ -607,26 +607,27 @@
return translateBool(setKeyStorageBindingSeed(seed));
}
-binder::Status VoldNativeService::createUserKey(int32_t userId, int32_t userSerial,
- bool ephemeral) {
+binder::Status VoldNativeService::createUserStorageKeys(int32_t userId, int32_t userSerial,
+ bool ephemeral) {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_CRYPT_LOCK;
- return translateBool(fscrypt_vold_create_user_key(userId, userSerial, ephemeral));
+ return translateBool(fscrypt_create_user_keys(userId, userSerial, ephemeral));
}
-binder::Status VoldNativeService::destroyUserKey(int32_t userId) {
+binder::Status VoldNativeService::destroyUserStorageKeys(int32_t userId) {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_CRYPT_LOCK;
- return translateBool(fscrypt_destroy_user_key(userId));
+ return translateBool(fscrypt_destroy_user_keys(userId));
}
-binder::Status VoldNativeService::setUserKeyProtection(int32_t userId, const std::string& secret) {
+binder::Status VoldNativeService::setCeStorageProtection(int32_t userId,
+ const std::string& secret) {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_CRYPT_LOCK;
- return translateBool(fscrypt_set_user_key_protection(userId, secret));
+ return translateBool(fscrypt_set_ce_key_protection(userId, secret));
}
binder::Status VoldNativeService::getUnlockedUsers(std::vector<int>* _aidl_return) {
@@ -637,19 +638,19 @@
return Ok();
}
-binder::Status VoldNativeService::unlockUserKey(int32_t userId, int32_t userSerial,
- const std::string& secret) {
+binder::Status VoldNativeService::unlockCeStorage(int32_t userId, int32_t userSerial,
+ const std::string& secret) {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_CRYPT_LOCK;
- return translateBool(fscrypt_unlock_user_key(userId, userSerial, secret));
+ return translateBool(fscrypt_unlock_ce_storage(userId, userSerial, secret));
}
-binder::Status VoldNativeService::lockUserKey(int32_t userId) {
+binder::Status VoldNativeService::lockCeStorage(int32_t userId) {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_CRYPT_LOCK;
- return translateBool(fscrypt_lock_user_key(userId));
+ return translateBool(fscrypt_lock_ce_storage(userId));
}
binder::Status VoldNativeService::prepareUserStorage(const std::optional<std::string>& uuid,