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

Commit 6a683ce0 authored by Kelvin Zhang's avatar Kelvin Zhang
Browse files

Merge identical key/val pairs in dynamic partition info

We might add new values to dynamic_partition_info.txt, so some kind of
generic fallback mechanism is needed. If keys are different, we need to
decided on a case-by-case basis which side takes precedence. For
example, Virtual AB requires vendor support, so vendor side takes
precedence. VABC on T+ devices are implemented entirely in system, so
system/framework side takes precedence.

Bug: 230876542
Test: th
Change-Id: I67747368547d3ef3e29ad64f8f818ef4c5896246
parent 62bf0d5c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1192,6 +1192,10 @@ def MergeDynamicPartitionInfoDicts(framework_dict, vendor_dict):
    raise ValueError("Both dictionaries must have use_dynamic_partitions=true")

  merged_dict = {"use_dynamic_partitions": "true"}
  # For keys-value pairs that are the same, copy to merged dict
  for key in vendor_dict.keys():
    if key in framework_dict and framework_dict[key] == vendor_dict[key]:
      merged_dict[key] = vendor_dict[key]

  merged_dict["dynamic_partition_list"] = uniq_concat(
      framework_dict.get("dynamic_partition_list", ""),