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

Commit 3acb8b47 authored by David Anderson's avatar David Anderson
Browse files

Remove support for IBootControl HALs 1.0 and 1.1.

Bug: 308446272
Test: builds
Change-Id: Ib177fdedb256de155bd84b58c0464e7ec71b4e8e
parent 9ccbab0d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ struct VariableHandlers {
};

static bool IsSnapshotUpdateInProgress(FastbootDevice* device) {
    auto hal = device->boot1_1();
    auto hal = device->boot_control_hal();
    if (!hal) {
        return false;
    }
@@ -349,8 +349,8 @@ bool SetActiveHandler(FastbootDevice* device, const std::vector<std::string>& ar
    }

    // Check how to handle the current snapshot state.
    if (auto hal11 = device->boot1_1()) {
        auto merge_status = hal11->getSnapshotMergeStatus();
    if (auto hal = device->boot_control_hal()) {
        auto merge_status = hal->getSnapshotMergeStatus();
        if (merge_status == MergeStatus::MERGING) {
            return device->WriteFail("Cannot change slots while a snapshot update is in progress");
        }
@@ -693,7 +693,7 @@ bool GsiHandler(FastbootDevice* device, const std::vector<std::string>& args) {
bool SnapshotUpdateHandler(FastbootDevice* device, const std::vector<std::string>& args) {
    // Note that we use the HAL rather than mounting /metadata, since we want
    // our results to match the bootloader.
    auto hal = device->boot1_1();
    auto hal = device->boot_control_hal();
    if (!hal) return device->WriteFail("Not supported");

    // If no arguments, return the same thing as a getvar. Note that we get the
+0 −8
Original line number Diff line number Diff line
@@ -150,14 +150,6 @@ std::string FastbootDevice::GetCurrentSlot() {
    return suffix;
}

BootControlClient* FastbootDevice::boot1_1() const {
    if (boot_control_hal_ &&
        boot_control_hal_->GetVersion() >= android::hal::BootControlVersion::BOOTCTL_V1_1) {
        return boot_control_hal_.get();
    }
    return nullptr;
}

bool FastbootDevice::WriteStatus(FastbootResult result, const std::string& message) {
    constexpr size_t kResponseReasonSize = 4;
    constexpr size_t kNumResponseTypes = 4;  // "FAIL", "OKAY", "INFO", "DATA"
+0 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ class FastbootDevice {
    std::vector<char>& download_data() { return download_data_; }
    Transport* get_transport() { return transport_.get(); }
    BootControlClient* boot_control_hal() const { return boot_control_hal_.get(); }
    BootControlClient* boot1_1() const;
    std::shared_ptr<aidl::android::hardware::fastboot::IFastboot> fastboot_hal() {
        return fastboot_hal_;
    }
+1 −1
Original line number Diff line number Diff line
@@ -461,7 +461,7 @@ bool GetSnapshotUpdateStatus(FastbootDevice* device, const std::vector<std::stri
                             std::string* message) {
    // Note that we use the HAL rather than mounting /metadata, since we want
    // our results to match the bootloader.
    auto hal = device->boot1_1();
    auto hal = device->boot_control_hal();
    if (!hal) {
        *message = "not supported";
        return false;
+0 −4
Original line number Diff line number Diff line
@@ -86,10 +86,6 @@ bool DeviceInfo::EnsureBootHal() {
            LOG(ERROR) << "Could not find IBootControl HAL";
            return false;
        }
        if (hal->GetVersion() < BootControlVersion::BOOTCTL_V1_1) {
            LOG(ERROR) << "Could not find IBootControl 1.1 HAL";
            return false;
        }
        boot_control_ = std::move(hal);
    }
    return true;