From 1cf8eb7559d161b8a11d83e2518316b25331fbb6 Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Fri, 5 Jul 2019 22:56:20 +0200 Subject: Add a GetMappedPackageLength to Updater Corresponds to GetMappedPackageAddress. There is at least one custom device recovery with an extension to copy the package somewhere else as a backup. Ability to do this was removed in change ag/955273. Test: lunch cf_x86_tv-eng; make Test: atest recovery_unit_test recovery_component_test Change-Id: I0e61d8a8839c47721874526504ea03b9ca7bafa9 --- edify/include/edify/updater_interface.h | 1 + updater/include/updater/updater.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/edify/include/edify/updater_interface.h b/edify/include/edify/updater_interface.h index a4d581eec..aa977e3c8 100644 --- a/edify/include/edify/updater_interface.h +++ b/edify/include/edify/updater_interface.h @@ -44,4 +44,5 @@ class UpdaterInterface { virtual ZipArchiveHandle GetPackageHandle() const = 0; virtual std::string GetResult() const = 0; virtual uint8_t* GetMappedPackageAddress() const = 0; + virtual size_t GetMappedPackageLength() const = 0; }; diff --git a/updater/include/updater/updater.h b/updater/include/updater/updater.h index 08816bf36..8676b6038 100644 --- a/updater/include/updater/updater.h +++ b/updater/include/updater/updater.h @@ -62,10 +62,12 @@ class Updater : public UpdaterInterface { std::string GetResult() const override { return result_; } - uint8_t* GetMappedPackageAddress() const override { return mapped_package_.addr; } + size_t GetMappedPackageLength() const override { + return mapped_package_.length; + } private: friend class UpdaterTestBase; -- cgit v1.2.3