Parse multiple packages from Omaha response.
The multi-payload info are stored in OmahaResponse and InstallPlan, but
we still can only apply the first payload for now.
Bug: 36252799
Test: mma -j
Test: update_engine_unittests
Change-Id: I5ca63944ae9082670d0e67888409374f140d4245
(cherry picked from commit 2aba8a87d4fac245a2e2d238b3159f8eabce630f)
diff --git a/payload_consumer/install_plan.h b/payload_consumer/install_plan.h
index 0e25cc3..db471da 100644
--- a/payload_consumer/install_plan.h
+++ b/payload_consumer/install_plan.h
@@ -56,10 +56,18 @@
std::string download_url; // url to download from
std::string version; // version we are installing.
- uint64_t payload_size{0}; // size of the payload
- brillo::Blob payload_hash; // SHA256 hash of the payload
- uint64_t metadata_size{0}; // size of the metadata
- std::string metadata_signature; // signature of the metadata
+ struct 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
+ brillo::Blob hash; // SHA256 hash of the payload
+
+ bool operator==(const Payload& that) const {
+ return size == that.size && metadata_size == that.metadata_size &&
+ metadata_signature == that.metadata_signature && hash == that.hash;
+ }
+ };
+ std::vector<Payload> payloads;
// The partition slots used for the update.
BootControlInterface::Slot source_slot{BootControlInterface::kInvalidSlot};