From bb39839614e6629f112313ab4abde7cbfa74fc5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Wed, 8 Jan 2025 11:59:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=20Signed-off-by:=20?= =?UTF-8?q?=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 6113454f..e511d20a 100644 --- a/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp +++ b/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp @@ -47,8 +47,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 4b672940..b5d79e98 100644 --- a/services/firmware/upgrade/flow/include/firmware_manager.h +++ b/services/firmware/upgrade/flow/include/firmware_manager.h @@ -61,7 +61,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 6ede3ae7..adb894b3 100644 --- a/services/firmware/upgrade/flow/src/firmware_manager.cpp +++ b/services/firmware/upgrade/flow/src/firmware_manager.cpp @@ -309,6 +309,12 @@ void FirmwareManager::HandleBootComplete() HandleBootUpdateOnStatusProcess(task); return; } + + // ab 升级安装完成 + if (task.status == UpgradeStatus::INSTALL_SUCCESS) { + HandleBootUpdateSuccess(task); + return; + } } void FirmwareManager::HandleNetChanged() @@ -354,7 +360,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); @@ -364,8 +370,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