Add build.version.incremental to metadata
Add the build property "build.version.incremental" of the source (if
present) and target files to the metadata of the ota update package.
Example of metadata:
....
post-build-incremental=2951741
post-timestamp=1465345123
pre-build-incremental=2943039
pre-device=bullhead
...
Bug: 28658632
Change-Id: I889e8ccf39633b1b35590751001a42d1b05d5514
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 861c485..4eb15cf 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -834,6 +834,10 @@
OPTIONS.target_info_dict)
metadata["pre-build"] = source_fp
metadata["post-build"] = target_fp
+ metadata["pre-build-incremental"] = GetBuildProp(
+ "ro.build.version.incremental", OPTIONS.source_info_dict)
+ metadata["post-build-incremental"] = GetBuildProp(
+ "ro.build.version.incremental", OPTIONS.target_info_dict)
source_boot = common.GetBootableImage(
"/tmp/boot.img", "boot.img", OPTIONS.source_tmp, "BOOT",
@@ -1178,6 +1182,8 @@
metadata = {
"post-build": CalculateFingerprint(oem_props, oem_dict,
OPTIONS.info_dict),
+ "post-build-incremental" : GetBuildProp("ro.build.version.incremental",
+ OPTIONS.info_dict),
"pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict,
OPTIONS.info_dict),
"post-timestamp": GetBuildProp("ro.build.date.utc", OPTIONS.info_dict),
@@ -1188,6 +1194,8 @@
if source_file is not None:
metadata["pre-build"] = CalculateFingerprint(oem_props, oem_dict,
OPTIONS.source_info_dict)
+ metadata["pre-build-incremental"] = GetBuildProp(
+ "ro.build.version.incremental", OPTIONS.source_info_dict)
# 1. Generate payload.
payload_file = common.MakeTempFile(prefix="payload-", suffix=".bin")
@@ -1493,6 +1501,10 @@
metadata["pre-build"] = source_fp
metadata["post-build"] = target_fp
+ metadata["pre-build-incremental"] = GetBuildProp(
+ "ro.build.version.incremental", OPTIONS.source_info_dict)
+ metadata["post-build-incremental"] = GetBuildProp(
+ "ro.build.version.incremental", OPTIONS.target_info_dict)
source_boot = common.GetBootableImage(
"/tmp/boot.img", "boot.img", OPTIONS.source_tmp, "BOOT",