Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79ab0e3e authored by David Anderson's avatar David Anderson
Browse files

fastbootd: Complete the implementation of getvar has-slot.

Bug: 78793464
Test: fastboot getvar has-slot:super returns "no"
Change-Id: I80f171df062c008718b810bbe12070834d4aa3fb
parent c4894316
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -123,10 +123,14 @@ bool GetHasSlot(FastbootDevice* device, const std::vector<std::string>& args) {
    }
    std::string slot_suffix = device->GetCurrentSlot();
    if (slot_suffix.empty()) {
        return device->WriteFail("Invalid slot");
        return device->WriteOkay("no");
    }
    std::string result = (args[0] == "userdata" ? "no" : "yes");
    return device->WriteOkay(result);
    std::string partition_name = args[0] + slot_suffix;
    if (FindPhysicalPartition(partition_name) ||
        LogicalPartitionExists(partition_name, slot_suffix)) {
        return device->WriteOkay("yes");
    }
    return device->WriteOkay("no");
}

bool GetPartitionSize(FastbootDevice* device, const std::vector<std::string>& args) {