From 8ef722e03355ec7b622157f2d0c7440bb2394539 Mon Sep 17 00:00:00 2001 From: lidezhi Date: Thu, 14 Aug 2025 15:29:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8E=92=E6=9F=A5=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lidezhi Change-Id: I36c0e9150fdf932b0e947bb18d656600d152324a --- frameworks/common/inc/user_auth_api_event_reporter.h | 2 +- services/base/src/finite_state_machine_builder.h | 4 ++-- services/core/src/delete_impl.cpp | 5 ----- services/core/src/delete_impl.h | 1 - services/core/src/enrolled_info_impl.h | 2 +- services/core/src/identification_impl.h | 2 +- services/core/src/publish_event_adapter.cpp | 1 + services/core/src/widget_schedule_node_impl.cpp | 1 + 8 files changed, 7 insertions(+), 11 deletions(-) diff --git a/frameworks/common/inc/user_auth_api_event_reporter.h b/frameworks/common/inc/user_auth_api_event_reporter.h index 6ccbf00e2..82b78f6f6 100644 --- a/frameworks/common/inc/user_auth_api_event_reporter.h +++ b/frameworks/common/inc/user_auth_api_event_reporter.h @@ -46,7 +46,7 @@ private: bool isReported_ = false; std::string transId_; std::string apiName_; - int64_t beginTime_; + int64_t beginTime_{0}; }; } // namespace UserAuth } // namespace UserIam diff --git a/services/base/src/finite_state_machine_builder.h b/services/base/src/finite_state_machine_builder.h index 41a891636..87aa77fab 100644 --- a/services/base/src/finite_state_machine_builder.h +++ b/services/base/src/finite_state_machine_builder.h @@ -43,8 +43,8 @@ public: private: std::string name_; - uint32_t initstate_; - bool valid_; + uint32_t initstate_{0}; + bool valid_{false}; FiniteStateMachineImpl::TransitionMap transitionMap_; FiniteStateMachineImpl::EnterMap enterMap_; FiniteStateMachineImpl::LeaveMap leaveMap_; diff --git a/services/core/src/delete_impl.cpp b/services/core/src/delete_impl.cpp index b421ab064..4b109632f 100644 --- a/services/core/src/delete_impl.cpp +++ b/services/core/src/delete_impl.cpp @@ -127,10 +127,6 @@ bool DeleteImpl::Update(const std::vector &scheduleResult, std::shared_ bool DeleteImpl::Cancel() { - if (!running_) { - return false; - } - running_ = false; return true; } @@ -155,7 +151,6 @@ bool DeleteImpl::StartSchedule(int32_t userId, HdiScheduleInfo &info, } scheduleId_ = scheduleList[0]->GetScheduleId(); - running_ = true; return true; } diff --git a/services/core/src/delete_impl.h b/services/core/src/delete_impl.h index b46b16291..f5b8f017c 100644 --- a/services/core/src/delete_impl.h +++ b/services/core/src/delete_impl.h @@ -55,7 +55,6 @@ private: uint32_t tokenId_ {0}; uint64_t scheduleId_ {0}; - bool running_ {false}; int32_t latestError_ = ResultCode::GENERAL_ERROR; }; } // namespace UserAuth diff --git a/services/core/src/enrolled_info_impl.h b/services/core/src/enrolled_info_impl.h index 54f1546c0..55c634b57 100644 --- a/services/core/src/enrolled_info_impl.h +++ b/services/core/src/enrolled_info_impl.h @@ -33,7 +33,7 @@ public: uint64_t GetEnrolledId() const override; private: - int32_t userId_; + int32_t userId_{INVALID_USER_ID}; HdiEnrolledInfo info_; }; } // namespace UserAuth diff --git a/services/core/src/identification_impl.h b/services/core/src/identification_impl.h index d9c523957..4ea531406 100644 --- a/services/core/src/identification_impl.h +++ b/services/core/src/identification_impl.h @@ -45,7 +45,7 @@ protected: void SetLatestError(int32_t error) override; private: - uint64_t contextId_; + uint64_t contextId_{0}; AuthType authType_; uint32_t executorIndex_ {0}; diff --git a/services/core/src/publish_event_adapter.cpp b/services/core/src/publish_event_adapter.cpp index 87f4b1c08..120f73498 100644 --- a/services/core/src/publish_event_adapter.cpp +++ b/services/core/src/publish_event_adapter.cpp @@ -113,6 +113,7 @@ void PublishEventAdapter::CachePinUpdateParam(int32_t userId, uint64_t scheduleI void PublishEventAdapter::CachePinUpdateParam(bool reEnrollFlag) { + std::lock_guard lock(mutex_); reEnrollFlag_ = reEnrollFlag; } diff --git a/services/core/src/widget_schedule_node_impl.cpp b/services/core/src/widget_schedule_node_impl.cpp index d869c7e19..b99c84074 100644 --- a/services/core/src/widget_schedule_node_impl.cpp +++ b/services/core/src/widget_schedule_node_impl.cpp @@ -190,6 +190,7 @@ bool WidgetScheduleNodeImpl::WidgetReload(uint32_t orientation, uint32_t needRot void WidgetScheduleNodeImpl::SetCallback(std::shared_ptr callback) { + std::lock_guard lock(mutex_); callback_ = callback; } -- Gitee