From a4208b5f90baf1326d372fd97ca39f06911d7165 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Mon, 14 Feb 2022 18:38:06 -0800 Subject: Perform data wipe in recovery if ota package has powerwash set Normally, if an ota package has --wipe_user_data flag, we set bootloader parameter --wipe_data, so that next boot into bootloader will wipe userdata. But this doesn't work in recovery, likely because after recovery we don't reboot to bootloader, but directly boot into android. Therefore perform data reset in recovery if the OTA package has POWERWASH flag. Bug: 203507329 Test: apply an OTA pkg with --wipe_user_data, verify that data wipe happened Change-Id: Icca4a5f74246bde44a5fd589395404c9f57867ee --- install/include/install/fuse_install.h | 2 +- install/include/install/install.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'install/include') diff --git a/install/include/install/fuse_install.h b/install/include/install/fuse_install.h index 63b116aeb..29c283f40 100644 --- a/install/include/install/fuse_install.h +++ b/install/include/install/fuse_install.h @@ -25,6 +25,6 @@ // Starts FUSE with the package from |path| as the data source. And installs the package from // |FUSE_SIDELOAD_HOST_PATHNAME|. The |path| can point to the location of a package zip file or a // block map file with the prefix '@'; e.g. /sdcard/package.zip, @/cache/recovery/block.map. -InstallResult InstallWithFuseFromPath(std::string_view path, RecoveryUI* ui); +InstallResult InstallWithFuseFromPath(std::string_view path, Device* device); InstallResult ApplyFromSdcard(Device* device); diff --git a/install/include/install/install.h b/install/include/install/install.h index 704841f8e..0f5102f82 100644 --- a/install/include/install/install.h +++ b/install/include/install/install.h @@ -25,6 +25,7 @@ #include #include "otautil/package.h" +#include "recovery_ui/device.h" #include "recovery_ui/ui.h" enum InstallResult { @@ -49,7 +50,8 @@ enum class OtaType { // cache partition after a successful installation if |should_wipe_cache| is true or an updater // command asks to wipe the cache. InstallResult InstallPackage(Package* package, const std::string_view package_id, - bool should_wipe_cache, int retry_count, RecoveryUI* ui); + bool should_wipe_cache, int retry_count, + Device* ui); // Verifies the package by ota keys. Returns true if the package is verified successfully, // otherwise returns false. -- cgit v1.2.3