Revert "Cleaned up some slot logic"
This reverts commit bd85a18d0bcdd3041357c846905c737f10732320.
Reason for revert: b/276759363
Change-Id: I3ba08cf4abeeb7769569512d50e7ff135438cf20
diff --git a/fastboot/task.cpp b/fastboot/task.cpp
index 3d2c975..9d4cb75 100644
--- a/fastboot/task.cpp
+++ b/fastboot/task.cpp
@@ -95,7 +95,7 @@
LOG(VERBOSE) << "Cannot optimize flashing super on non-AB device";
return nullptr;
}
- if (fp->slot_override == "all") {
+ if (fp->slot == "all") {
LOG(VERBOSE) << "Cannot optimize flashing super for all slots";
return nullptr;
}
@@ -132,7 +132,7 @@
}
for (const auto& entry : os_images) {
- auto partition = GetPartitionName(entry);
+ auto partition = GetPartitionName(entry, fp->current_slot);
auto image = entry.first;
if (!helper->AddPartition(partition, image->img_name, image->optional_if_no_image)) {
@@ -145,7 +145,7 @@
// Remove images that we already flashed, just in case we have non-dynamic OS images.
auto remove_if_callback = [&](const ImageEntry& entry) -> bool {
- return helper->WillFlash(GetPartitionName(entry));
+ return helper->WillFlash(GetPartitionName(entry, fp->current_slot));
};
os_images.erase(std::remove_if(os_images.begin(), os_images.end(), remove_if_callback),
os_images.end());