Add a wrapper class PartitionBuildProp

The build prop for a partition used to be a simple key:value
dictionary. But we need more fields to hold the alternative build
props overriden by the 'import' statement. Therefore, add a new
class as a wrapper for these props first.

Bug: 152167826
Test: unittests pass
Change-Id: I2fe7e93a2f4de8e55f5f8051b000b96b5efdc85a
This commit is contained in:
Tianjie
2020-04-25 19:55:54 -07:00
parent dc8a239c69
commit fd3883f159
7 changed files with 367 additions and 230 deletions

View File

@@ -509,9 +509,9 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
d = {}
if "build.prop" in glob_dict:
bp = glob_dict["build.prop"]
if "ro.build.date.utc" in bp:
d["timestamp"] = bp["ro.build.date.utc"]
timestamp = glob_dict["build.prop"].GetProp("ro.build.date.utc")
if timestamp:
d["timestamp"] = timestamp
def copy_prop(src_p, dest_p):
"""Copy a property from the global dictionary.