From 44f4b6e4ae64f56b679c7bb819815d5d2228cf56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Mon, 7 Jul 2025 18:56:36 +0800 Subject: [PATCH] =?UTF-8?q?ab=20=E5=8D=87=E7=BA=A7=E9=80=9A=E7=9F=A5=20Sig?= =?UTF-8?q?ned-off-by:=20=E9=82=B9=E5=8F=8B=E6=9D=BE=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../upgrade/executor/src/firmware_apply_executor.cpp | 2 -- .../firmware/upgrade/flow/include/firmware_manager.h | 2 +- .../firmware/upgrade/flow/src/firmware_manager.cpp | 11 ++++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp b/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp index b8aa6c9e..902fe595 100644 --- a/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp +++ b/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp @@ -50,8 +50,6 @@ void FirmwareApplyExecutor::DoInstall() firmwareApplyCallback_.applyCallback(false); return; } - GetTask(); - FirmwareTaskOperator().UpdateProgressByTaskId(tasks_.taskId, UpgradeStatus::UPDATING, 0); sleep(Firmware::SLEEP_TIME_BEFORE_REBOOT); DoReboot(NULL); // ab apply } diff --git a/services/firmware/upgrade/flow/include/firmware_manager.h b/services/firmware/upgrade/flow/include/firmware_manager.h index 5adfaab2..87a2a289 100644 --- a/services/firmware/upgrade/flow/include/firmware_manager.h +++ b/services/firmware/upgrade/flow/include/firmware_manager.h @@ -63,7 +63,7 @@ private: void HandleBootDownloadOnStatusProcess(FirmwareTask &task); void HandleBootDownloadPauseStatusProcess(FirmwareTask &task); void HandleBootDownloadedStatusProcess(FirmwareTask &task); - void HandleBootUpdateSuccess(const FirmwareTask &task, const std::map &resultMap); + void HandleBootUpdateSuccess(const FirmwareTask &task); void HandleBootUpdateFail(const FirmwareTask &task, const std::map &resultMap); void DoAutoDownload(const FirmwareTask &task); diff --git a/services/firmware/upgrade/flow/src/firmware_manager.cpp b/services/firmware/upgrade/flow/src/firmware_manager.cpp index 374c65de..c5f7bfe5 100644 --- a/services/firmware/upgrade/flow/src/firmware_manager.cpp +++ b/services/firmware/upgrade/flow/src/firmware_manager.cpp @@ -310,6 +310,12 @@ void FirmwareManager::HandleBootComplete() HandleBootUpdateOnStatusProcess(task); return; } + + // ab 升级安装完成 + if (task.status == UpgradeStatus::INSTALL_SUCCESS) { + HandleBootUpdateSuccess(task); + return; + } } void FirmwareManager::HandleNetChanged() @@ -357,7 +363,7 @@ void FirmwareManager::HandleBootUpdateOnStatusProcess(const FirmwareTask &task) FirmwareComponentOperator().QueryAll(components); switch (resultProcess.GetUpdaterResult(components, resultMap)) { case UpdateResultCode::SUCCESS: - HandleBootUpdateSuccess(task, resultMap); + HandleBootUpdateSuccess(task); break; case UpdateResultCode::FAILURE: HandleBootUpdateFail(task, resultMap); @@ -367,8 +373,7 @@ void FirmwareManager::HandleBootUpdateOnStatusProcess(const FirmwareTask &task) } } -void FirmwareManager::HandleBootUpdateSuccess(const FirmwareTask &task, - const std::map &resultMap) +void FirmwareManager::HandleBootUpdateSuccess(const FirmwareTask &task) { preferencesUtil_->SaveString(Firmware::UPDATE_ACTION, "upgrade"); std::vector components; -- Gitee