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
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index f30f787..7567346 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -509,9 +509,9 @@
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.