From cf60a44bd497599363c0efcab23eb6be376c741f Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Mon, 18 Jun 2018 14:56:20 -0700 Subject: Drop the dependency on AB_OTA_UPDATER flag. This shortens the gap between A/B and non-A/B builds, by replacing the dependency on build-time flag with runtime detection instead. It also allows building and testing both paths regardless of the target OTA type. The size increase to /sbin/recovery looks negligible (< 0.01%). - marlin: increased from 2084928 to 2085024; - angler: increased from 2084776 to 2084896. Test: Run recovery_component_test on angler and marlin. Test: Sideload an A/B OTA package on marlin. Test: Sideload a non-A/B OTA package on angler. Change-Id: I1d927d1ede9713fb42f73b4fe324aa5705ee6f99 --- private/install.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'private/install.h') diff --git a/private/install.h b/private/install.h index ef64bd41d..7fdc741d6 100644 --- a/private/install.h +++ b/private/install.h @@ -23,9 +23,17 @@ #include -// Extract the update binary from the open zip archive |zip| located at |package| to |binary_path|. -// Store the command line that should be called into |cmd|. The |status_fd| is the file descriptor -// the child process should use to report back the progress of the update. -int update_binary_command(const std::string& package, ZipArchiveHandle zip, - const std::string& binary_path, int retry_count, int status_fd, +// Sets up the commands for a non-A/B update. Extracts the updater binary from the open zip archive +// |zip| located at |package|. Stores the command line that should be called into |cmd|. The +// |status_fd| is the file descriptor the child process should use to report back the progress of +// the update. +int SetUpNonAbUpdateCommands(const std::string& package, ZipArchiveHandle zip, int retry_count, + int status_fd, std::vector* cmd); + +// Sets up the commands for an A/B update. Extracts the needed entries from the open zip archive +// |zip| located at |package|. Stores the command line that should be called into |cmd|. The +// |status_fd| is the file descriptor the child process should use to report back the progress of +// the update. Note that since this applies to the sideloading flow only, it takes one less +// parameter |retry_count| than the non-A/B version. +int SetUpAbUpdateCommands(const std::string& package, ZipArchiveHandle zip, int status_fd, std::vector* cmd); -- cgit v1.2.3