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
This commit is contained in:
Robin Lee 2019-07-05 22:56:20 +02:00
parent 9341e970ba
commit 1cf8eb7559
2 changed files with 4 additions and 1 deletions

View file

@ -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;
};

View file

@ -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;