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

Commit 4d003534 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "LegacyStorage: Fix logic to be more robust" am: 7be4cc54 am: 24484736

Change-Id: I40fd0c459daaa698250bfc767f630a40a7241145
parents 7516bcb1 24484736
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -23,7 +23,15 @@ namespace storage {

struct LegacyModule::impl {
  void config_read(const std::string filename, LegacyReadConfigCallback callback, os::Handler* handler) {
    handler->Post(common::BindOnce(std::move(callback), filename, legacy::osi::config::config_new(filename.c_str())));
    std::unique_ptr<config_t> config = legacy::osi::config::config_new(filename.c_str());
    if (config && !legacy::osi::config::config_has_section(*config, "Adapter")) {
      LOG_ERROR("Config is missing adapter section");
      config = nullptr;
    }
    if (!config) {
      config = legacy::osi::config::config_new_empty();
    }
    handler->Post(common::BindOnce(std::move(callback), filename, std::move(config)));
  }

  void config_write(const std::string filename, const config_t config, LegacyWriteConfigCallback callback,