payload_generator: Remove unused attributes
Some attributes are not used by the client. Removed all instances of
of "ignored" and option ttributes from delta generation. Removed
all instances of ImageInfo and moved target and source version
to paygen_payload.
BUG=b:163048638
TEST=FEATURES=test emerge-hatch update_engine
TEST=FEATURES=test emerge update_payload
TEST=./run_pytest lib/paygen/paygen_payload_lib_unittest.py
Change-Id: I9102d37fcf054f2cbeb79e54113925a684de1cfb
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2388163
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Tested-by: Vyshu Khota <vyshu@google.com>
Commit-Queue: Vyshu Khota <vyshu@google.com>
diff --git a/payload_generator/payload_properties.cc b/payload_generator/payload_properties.cc
index bc82eb7..bcf4fbd 100644
--- a/payload_generator/payload_properties.cc
+++ b/payload_generator/payload_properties.cc
@@ -47,8 +47,6 @@
// These are needed by the Nebraska and devserver.
const char kPayloadPropertyJsonPayloadSize[] = "size";
const char kPayloadPropertyJsonIsDelta[] = "is_delta";
-const char kPayloadPropertyJsonTargetVersion[] = "target_version";
-const char kPayloadPropertyJsonSourceVersion[] = "source_version";
} // namespace
PayloadProperties::PayloadProperties(const string& payload_path)
@@ -65,10 +63,6 @@
properties.SetInteger(kPayloadPropertyJsonPayloadSize, payload_size_);
properties.SetString(kPayloadPropertyJsonPayloadHash, payload_hash_);
properties.SetBoolean(kPayloadPropertyJsonIsDelta, is_delta_);
- properties.SetString(kPayloadPropertyJsonTargetVersion, target_version_);
- if (is_delta_) {
- properties.SetString(kPayloadPropertyJsonSourceVersion, source_version_);
- }
return base::JSONWriter::Write(properties, json_str);
}
@@ -119,23 +113,11 @@
metadata_signatures_ = base::JoinString(base64_signatures, ":");
}
- is_delta_ = manifest.has_old_image_info() ||
- std::any_of(manifest.partitions().begin(),
+ is_delta_ = std::any_of(manifest.partitions().begin(),
manifest.partitions().end(),
[](const PartitionUpdate& part) {
return part.has_old_partition_info();
});
-
- if (manifest.has_new_image_info()) {
- target_version_ = manifest.new_image_info().version();
- } else {
- target_version_ = "99999.0.0";
- }
-
- // No need to set the source version if it was not a delta payload.
- if (is_delta_ && manifest.has_old_image_info()) {
- source_version_ = manifest.old_image_info().version();
- }
return true;
}