Define the protobuf for OTA metadata
Background in http://go/android-partial-updates. For partial update
(e.g. system-only) or devices with mixed build, the current
fingerprint & device name no longer suffice as the precondition to
install the package.
Therefore, we need to additionally include the per-partition build
props into the ota metadata. We also define a protobuf for the metadata
so it can be extended later. The metadata of the legacy format is also
kept for backward compatibility.
Bug: 151088567
Test: unittest pass, generate an OTA and check the result
Change-Id: I716f7da54a393cd340280dbddc3c92b3460f8ef8
diff --git a/tools/releasetools/Android.bp b/tools/releasetools/Android.bp
index 21134b6..7f727fb 100644
--- a/tools/releasetools/Android.bp
+++ b/tools/releasetools/Android.bp
@@ -89,16 +89,35 @@
],
}
+python_library_host {
+ name: "ota_metadata_proto",
+ version: {
+ py2: {
+ enabled: true,
+ },
+ py3: {
+ enabled: true,
+ },
+ },
+ srcs: [
+ "ota_metadata.proto",
+ ],
+ proto: {
+ canonical_path_from_root: false,
+ },
+}
+
python_defaults {
name: "releasetools_ota_from_target_files_defaults",
srcs: [
"edify_generator.py",
- "ota_from_target_files.py",
"non_ab_ota.py",
- "target_files_diff.py",
+ "ota_from_target_files.py",
"ota_utils.py",
+ "target_files_diff.py",
],
libs: [
+ "ota_metadata_proto",
"releasetools_check_target_files_vintf",
"releasetools_common",
"releasetools_verity_utils",