Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12ac74a1 authored by Jooyung Han's avatar Jooyung Han Committed by Gerrit Code Review
Browse files

Merge "Use optional for nullable types"

parents 23a32581 f452968a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -113,10 +113,10 @@ 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) {
                                  std::optional<std::string>* _aidl_return) {
  assert(_aidl_return);
  SYSTRACE << "Idmap2Service::createIdmap " << target_apk_path << " " << overlay_apk_path;
  _aidl_return->reset(nullptr);
  _aidl_return->reset();

  const PolicyBitmask policy_bitmask = ConvertAidlArgToPolicyBitmask(fulfilled_policies);

@@ -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 = idmap_path;
  return ok();
}

+2 −2
Original line number Diff line number Diff line
@@ -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 @@ class Idmap2Service : public BinderService<Idmap2Service>, public BnIdmap2 {
  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