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

Commit 9e93ae44 authored by Brandon Liu's avatar Brandon Liu
Browse files

Fix target path and overlay path loading order from idmap file

Bug: b/267121762
Test: Verified affected atests pass
Change-Id: I59d34c6d25a1f47bde1dd00e23e3f4d54127a531
parent e261092b
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -294,14 +294,14 @@ std::unique_ptr<LoadedIdmap> LoadedIdmap::Load(StringPiece idmap_path, StringPie
                               dtohl(header->version), kIdmapCurrentVersion);
    return {};
  }
  std::optional<std::string_view> overlay_path = ReadString(&data_ptr, &data_size, "overlay path");
  if (!overlay_path) {
    return {};
  }
  std::optional<std::string_view> target_path = ReadString(&data_ptr, &data_size, "target path");
    if (!target_path) {
      return {};
    }
  std::optional<std::string_view> overlay_path = ReadString(&data_ptr, &data_size, "overlay path");
  if (!overlay_path) {
    return {};
  }
  if (!ReadString(&data_ptr, &data_size, "target name") ||
      !ReadString(&data_ptr, &data_size, "debug info")) {
    return {};
@@ -364,7 +364,7 @@ std::unique_ptr<LoadedIdmap> LoadedIdmap::Load(StringPiece idmap_path, StringPie
  return std::unique_ptr<LoadedIdmap>(
      new LoadedIdmap(std::string(idmap_path), header, data_header, target_entries,
                      target_inline_entries, target_inline_entry_values, configurations,
                      overlay_entries, std::move(idmap_string_pool), *target_path, *overlay_path));
                      overlay_entries, std::move(idmap_string_pool), *overlay_path, *target_path));
}

bool LoadedIdmap::IsUpToDate() const {