From 45719a8f07b5062dcd9a2df03fe34b27ec2b6a91 Mon Sep 17 00:00:00 2001 From: Hridya Valsaraju Date: Mon, 2 Mar 2020 13:03:47 -0800 Subject: [PATCH] fastbootd: use FastbootDevice::GetCurrentSlot to get current slot suffix Using FastbootDevice::GetCurrentSlot to get the current slot suffix instead of reading the same from the device's boot control HAL is required to account for the prior set_active commands issued via fastbootd in the same boot. Test: fuzzy_fastboot --gtest_filter=Conformance.Slots:Conformance.SetActive --gtest_repeat=10 Bug: 146589281 Change-Id: I2edb0f024d93c2483659623423ef5c69c717c7af --- fastboot/device/commands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastboot/device/commands.cpp b/fastboot/device/commands.cpp index 2c9dec9fc..ca120c62a 100644 --- a/fastboot/device/commands.cpp +++ b/fastboot/device/commands.cpp @@ -261,7 +261,7 @@ bool SetActiveHandler(FastbootDevice* device, const std::vector& ar } // If the slot is not changing, do nothing. - if (slot == boot_control_hal->getCurrentSlot()) { + if (args[1] == device->GetCurrentSlot()) { return device->WriteOkay(""); }