From a80db15282732c448fe2d1f3f963ef816e641c50 Mon Sep 17 00:00:00 2001 From: Zhao-PengFei35 Date: Tue, 22 Aug 2023 22:17:03 +0800 Subject: [PATCH] fix bug of maintenance Signed-off-by: Zhao-PengFei35 --- plugins/ext/src/base_state.cpp | 2 +- services/common/include/time_provider.h | 2 +- services/common/src/time_provider.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/ext/src/base_state.cpp b/plugins/ext/src/base_state.cpp index d76c486..2b414e2 100644 --- a/plugins/ext/src/base_state.cpp +++ b/plugins/ext/src/base_state.cpp @@ -209,7 +209,7 @@ int64_t StateWithMaint::CalculateMaintTimeOut(const std::shared_ptrGetWallTimeMs() / MSEC_PER_SEC; + if (curSecTimeStamp == -1) { + curSecTimeStamp = MiscServices::TimeServiceClient::GetInstance()->GetWallTimeMs() / MSEC_PER_SEC; + } bool res {false}; STANDBYSERVICE_LOGD("condition is %{public}u", GetCondition()); if (GetCondition() == ConditionType::NIGHT_STANDBY) { -- Gitee