Remove userSerial param from vold methods that don't use it
createUserStorageKeys(), unlockCeStorage(), and prepareUserStorage()
have a user serial number parameter, but they don't actually do anything
with it except log it. Remove this unnecessary parameter.
Bug: 316035110
Test: presubmit
Flag: N/A, mechanical refactoring
Change-Id: I73ebae1afb2bdb7ca856b40b34ce806fdda718fe
diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp
index c39604b..65731af 100644
--- a/VoldNativeService.cpp
+++ b/VoldNativeService.cpp
@@ -607,12 +607,11 @@
return translateBool(setKeyStorageBindingSeed(seed));
}
-binder::Status VoldNativeService::createUserStorageKeys(int32_t userId, int32_t userSerial,
- bool ephemeral) {
+binder::Status VoldNativeService::createUserStorageKeys(int32_t userId, bool ephemeral) {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_CRYPT_LOCK;
- return translateBool(fscrypt_create_user_keys(userId, userSerial, ephemeral));
+ return translateBool(fscrypt_create_user_keys(userId, ephemeral));
}
binder::Status VoldNativeService::destroyUserStorageKeys(int32_t userId) {
@@ -638,12 +637,11 @@
return Ok();
}
-binder::Status VoldNativeService::unlockCeStorage(int32_t userId, int32_t userSerial,
- const std::string& secret) {
+binder::Status VoldNativeService::unlockCeStorage(int32_t userId, const std::string& secret) {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_CRYPT_LOCK;
- return translateBool(fscrypt_unlock_ce_storage(userId, userSerial, secret));
+ return translateBool(fscrypt_unlock_ce_storage(userId, secret));
}
binder::Status VoldNativeService::lockCeStorage(int32_t userId) {
@@ -654,15 +652,14 @@
}
binder::Status VoldNativeService::prepareUserStorage(const std::optional<std::string>& uuid,
- int32_t userId, int32_t userSerial,
- int32_t flags) {
+ int32_t userId, int32_t flags) {
ENFORCE_SYSTEM_OR_ROOT;
std::string empty_string = "";
auto uuid_ = uuid ? *uuid : empty_string;
CHECK_ARGUMENT_HEX(uuid_);
ACQUIRE_CRYPT_LOCK;
- return translateBool(fscrypt_prepare_user_storage(uuid_, userId, userSerial, flags));
+ return translateBool(fscrypt_prepare_user_storage(uuid_, userId, flags));
}
binder::Status VoldNativeService::destroyUserStorage(const std::optional<std::string>& uuid,