Removing double delete from flashall

From aosp/2475604 the functionality of deleting retrofit partitions
wasn't added back correctly. aosp/837186 adds this logic in. We should
only have one delete that exists if the image is secondary and is
dynamic.

Unfortunately don't have a retrofit device to test on, but from an eye
test this logic seems to match the old functionality and should be
working

Test: m fastboot
Change-Id: I5481893ab1638541d21813efe1c4aab5219e1dcd
This commit is contained in:
Daniel Zheng 2023-09-19 16:14:50 -07:00
parent 1b52ac6efe
commit 2e6aee5316

View file

@ -350,8 +350,7 @@ Result<NetworkSerial, FastbootError> ParseNetworkSerial(const std::string& seria
//
// The returned Transport is a singleton, so multiple calls to this function will return the same
// object, and the caller should not attempt to delete the returned Transport.
static std::unique_ptr<Transport> open_device(const char* local_serial,
bool wait_for_device = true,
static std::unique_ptr<Transport> open_device(const char* local_serial, bool wait_for_device = true,
bool announce = true) {
const Result<NetworkSerial, FastbootError> network_serial = ParseNetworkSerial(local_serial);
@ -1885,9 +1884,8 @@ std::vector<std::unique_ptr<Task>> FlashAllTool::CollectTasksFromImageList() {
if (is_retrofit_device(fp_->fb)) {
std::string partition_name = image->part_name + "_"s + slot;
if (image->IsSecondary() && should_flash_in_userspace(partition_name)) {
fp_->fb->DeletePartition(partition_name);
tasks.emplace_back(std::make_unique<DeleteTask>(fp_, partition_name));
}
tasks.emplace_back(std::make_unique<DeleteTask>(fp_, partition_name));
}
}