/* * Copyright (C) 2026 oxmc / PawletOS * SPDX-License-Identifier: Apache-2.0 */ #include "service.h" namespace pawlet::hwupdate { namespace aidl = ::me::pawlet::hardware::update; using ::android::binder::Status; Status HwUpdateService::getComponents(::std::vector* out) { out->clear(); for (const auto& c : engine_->Components()) { aidl::HwComponent hc; hc.componentId = c.componentId; hc.productId = c.productId; hc.componentClass = c.componentClass; hc.role = c.role; hc.transport = c.transport; hc.present = c.present; hc.installedVersion = c.installedVersion; hc.hardwareRevision = c.hardwareRevision; hc.support = c.support; out->push_back(std::move(hc)); } return Status::ok(); } Status HwUpdateService::getPendingUpdates(::std::vector* out) { out->clear(); for (const auto& p : engine_->Pending()) { aidl::HwUpdateInfo hu; hu.componentId = p.componentId; hu.available = p.available; hu.version = p.version; hu.sizeBytes = p.sizeBytes; hu.changelogUrl = p.changelogUrl; out->push_back(std::move(hu)); } return Status::ok(); } Status HwUpdateService::checkNow() { engine_->CheckNow(); return Status::ok(); } Status HwUpdateService::isBusy(bool* out) { *out = engine_->IsBusy(); return Status::ok(); } Status HwUpdateService::getLastResult(int32_t* out) { *out = engine_->LastResult(); return Status::ok(); } } // namespace pawlet::hwupdate