Reland "Add a wrapper class PartitionBuildProp""
This reverts commit 6022545272a7360f7faa5e00ad0e7a8f5ed9d5c3.
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
Change-Id: I5c952cd2a976ba1a09ddc66d56c2b8b55a61986b
Test: unittests pass
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.