update_engine: Fix Install Plan Dump() misleading prints
The new way of Dump()'ing the payload urls will be per payload. This
will cause less confusion while reading the InstallPlan Dump() when
payload urls vary per payload package.
Now the log will also show payload urls that are include multiple urls
for InstallPlan Dump()'s.
Previous:
[0106/095336.470400:INFO:install_plan.cc(83)] InstallPlan: new_update,
version: 12804.0.0, source_slot: INVALID, target_slot: A, url: fi
le:///usr/local/dlc/test1-dlc/test-package/dlcservice_test-dlc.payload,
payload: (size: 797, metadata_size: 0, metadata signature: , has
h: 9E117706017CC676BB5B9EABDFC7B9A9EF1C650D72F6B411031A4FD1161A9878,
payload type: full), payload: (size: 797, metadata_size: 0, metadat
a signature: , hash:
47D86E6F790048EBE45597B709BED5A724760160222926F1C9D88F045AE70737,
payload type: full), hash_checks_mandatory: false
, powerwash_required: false, switch_slot_on_reboot: true,
run_post_install: true, is_rollback: false, write_verity: true
New:
[0106/130245.144640:INFO:install_plan.cc(90)] Install
Plan: new_update, version: 12804.0.0, source_slot: IN
VALID, target_slot: A, initial url: file:///usr/local
/dlc/test1-dlc/test-package/dlcservice_test-dlc.paylo
ad, payload: (urls: (file:///usr/local/dlc/test1-dlc/
test-package/dlcservice_test-dlc.payload), size: 797,
metadata_size: 0, metadata signature: , hash: 9E1177
06017CC676BB5B9EABDFC7B9A9EF1C650D72F6B411031A4FD1161
A9878, payload type: full), payload: (urls: (file:///
usr/local/dlc/test2-dlc/test-package/dlcservice_test-
dlc.payload), size: 797, metadata_size: 0, metadata s
ignature: , hash: 47D86E6F790048EBE45597B709BED5A7247
60160222926F1C9D88F045AE70737, payload type: full), h
ash_checks_mandatory: false, powerwash_required: fals
e, switch_slot_on_reboot: true, run_post_install: tru
e, is_rollback: false, write_verity: true
BUG=chromium:1036850
TEST=# invoke Omaha respone with varying payload urls
Change-Id: I970b1297d8a6b18f378d07583119246f10378d3e
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1980276
Tested-by: Jae Hoon Kim <[email protected]>
Reviewed-by: Amin Hassani <[email protected]>
Reviewed-by: Andrew Lassalle <[email protected]>
Commit-Queue: Jae Hoon Kim <[email protected]>
diff --git a/payload_consumer/install_plan.h b/payload_consumer/install_plan.h
index 17cefd8..7a95ab4 100644
--- a/payload_consumer/install_plan.h
+++ b/payload_consumer/install_plan.h
@@ -58,6 +58,7 @@
std::string system_version;
struct Payload {
+ std::vector<std::string> payload_urls; // URLs to download the payload
uint64_t size = 0; // size of the payload
uint64_t metadata_size = 0; // size of the metadata
std::string metadata_signature; // signature of the metadata in base64
@@ -69,7 +70,8 @@
bool already_applied = false;
bool operator==(const Payload& that) const {
- return size == that.size && metadata_size == that.metadata_size &&
+ return payload_urls == that.payload_urls && size == that.size &&
+ metadata_size == that.metadata_size &&
metadata_signature == that.metadata_signature &&
hash == that.hash && type == that.type &&
already_applied == that.already_applied;