Use optional for nullable types

AIDL generates optional<T> for nullable T types for C++, which is more
efficient and idomatic and easy to use.

Bug: 144773267
Test: build/flash/boot
Merged-In: I98549c8614c9152d5d45e2f1f33f2f3c31a9bbbf
Change-Id: I98549c8614c9152d5d45e2f1f33f2f3c31a9bbbf
(cherry picked from commit 3ce0ee5363)

Exempt-From-Owner-Approval: CP from master
This commit is contained in:
Jooyung Han 2020-01-23 13:23:26 +09:00
parent 6a4d95d08e
commit 4fcb707ecd
2 changed files with 4 additions and 4 deletions

View file

@ -811,7 +811,7 @@ binder::Status VoldNativeService::lockUserKey(int32_t userId) {
return translateBool(fscrypt_lock_user_key(userId));
}
binder::Status VoldNativeService::prepareUserStorage(const std::unique_ptr<std::string>& uuid,
binder::Status VoldNativeService::prepareUserStorage(const std::optional<std::string>& uuid,
int32_t userId, int32_t userSerial,
int32_t flags) {
ENFORCE_SYSTEM_OR_ROOT;
@ -823,7 +823,7 @@ binder::Status VoldNativeService::prepareUserStorage(const std::unique_ptr<std::
return translateBool(fscrypt_prepare_user_storage(uuid_, userId, userSerial, flags));
}
binder::Status VoldNativeService::destroyUserStorage(const std::unique_ptr<std::string>& uuid,
binder::Status VoldNativeService::destroyUserStorage(const std::optional<std::string>& uuid,
int32_t userId, int32_t flags) {
ENFORCE_SYSTEM_OR_ROOT;
std::string empty_string = "";

View file

@ -123,9 +123,9 @@ class VoldNativeService : public BinderService<VoldNativeService>, public os::Bn
const std::string& secret);
binder::Status lockUserKey(int32_t userId);
binder::Status prepareUserStorage(const std::unique_ptr<std::string>& uuid, int32_t userId,
binder::Status prepareUserStorage(const std::optional<std::string>& uuid, int32_t userId,
int32_t userSerial, int32_t flags);
binder::Status destroyUserStorage(const std::unique_ptr<std::string>& uuid, int32_t userId,
binder::Status destroyUserStorage(const std::optional<std::string>& uuid, int32_t userId,
int32_t flags);
binder::Status prepareSandboxForApp(const std::string& packageName, int32_t appId,