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: I90cf2ce1193c479179687d71a5c1416f6cdf0b16
Change-Id: I90cf2ce1193c479179687d71a5c1416f6cdf0b16
(cherry picked from commit ff7f4279bd7fa33577f5f4d46aa9de322fb625d4)
Exempt-From-Owner-Approval: CP from master
diff --git a/cmds/idmap2/idmap2d/Idmap2Service.h b/cmds/idmap2/idmap2d/Idmap2Service.h
index 1aab059..73a236a 100644
--- a/cmds/idmap2/idmap2d/Idmap2Service.h
+++ b/cmds/idmap2/idmap2d/Idmap2Service.h
@@ -20,7 +20,7 @@
#include <android-base/unique_fd.h>
#include <binder/BinderService.h>
-#include <memory>
+#include <optional>
#include <string>
#include "android/os/BnIdmap2.h"
@@ -45,7 +45,7 @@
binder::Status createIdmap(const std::string& target_apk_path,
const std::string& overlay_apk_path, int32_t fulfilled_policies,
bool enforce_overlayable, int32_t user_id,
- std::unique_ptr<std::string>* _aidl_return);
+ std::optional<std::string>* _aidl_return);
};
} // namespace android::os