summaryrefslogtreecommitdiff
path: root/cmds/idmap2/idmap2d/Idmap2Service.cpp
diff options
context:
space:
mode:
authorJooyung Han <jooyung@google.com>2020-03-07 21:47:09 +0900
committerJooyung Han <jooyung@google.com>2020-03-12 11:36:33 +0000
commit66c567a8c48f1fda8ed15bd59d6e49115e0eea7b (patch)
tree873911e2aec654ff38f8f634b44ed17d07d71577 /cmds/idmap2/idmap2d/Idmap2Service.cpp
parent97363dce3c74071830fd61a67ff1a7b5bb832f01 (diff)
Use aidl::nullable for nullable type in C++
To reduce the discrepance between old code which still uses std::unique_ptr and new code using std::optional. This might help to avoid merge-conflicts between branches. Bug: 144773267 Test: m Merged-In: Ie3196ee5cce17d77950eea9479d2cc1406e9e674 Merged-In: I33822bc76ef87637d5408849f64a0607e121792e Change-Id: I33822bc76ef87637d5408849f64a0607e121792e (cherry picked from commit ad62e8cbf5cf6083568f6f230ef7d73ad8776971) Exempt-From-Owner-Approval: cherry-pick from master with owner's approval
Diffstat (limited to 'cmds/idmap2/idmap2d/Idmap2Service.cpp')
-rw-r--r--cmds/idmap2/idmap2d/Idmap2Service.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds/idmap2/idmap2d/Idmap2Service.cpp b/cmds/idmap2/idmap2d/Idmap2Service.cpp
index f84e4b5f2575..8f5e49d5b428 100644
--- a/cmds/idmap2/idmap2d/Idmap2Service.cpp
+++ b/cmds/idmap2/idmap2d/Idmap2Service.cpp
@@ -113,7 +113,7 @@ Status Idmap2Service::verifyIdmap(const std::string& overlay_apk_path,
Status Idmap2Service::createIdmap(const std::string& target_apk_path,
const std::string& overlay_apk_path, int32_t fulfilled_policies,
bool enforce_overlayable, int32_t user_id ATTRIBUTE_UNUSED,
- std::unique_ptr<std::string>* _aidl_return) {
+ aidl::nullable<std::string>* _aidl_return) {
assert(_aidl_return);
SYSTRACE << "Idmap2Service::createIdmap " << target_apk_path << " " << overlay_apk_path;
_aidl_return->reset(nullptr);
@@ -155,7 +155,7 @@ Status Idmap2Service::createIdmap(const std::string& target_apk_path,
return error("failed to write to idmap path " + idmap_path);
}
- *_aidl_return = std::make_unique<std::string>(idmap_path);
+ *_aidl_return = aidl::make_nullable<std::string>(idmap_path);
return ok();
}