From e63bf8bcb9b412e799217e40981012fc1db2e822 Mon Sep 17 00:00:00 2001 From: youshugen Date: Sat, 31 Aug 2024 17:16:11 +0800 Subject: [PATCH] fix: alarming improve Signed-off-by: youshugen --- .../state_machine/state_collection_factory.cpp | 2 +- services/native/src/thermal_observer/thermal_sensor_info.cpp | 2 +- .../src/thermal_policy/thermal_config_sensor_cluster.cpp | 4 ++++ utils/native/include/constants.h | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/services/native/src/thermal_observer/state_machine/state_collection_factory.cpp b/services/native/src/thermal_observer/state_machine/state_collection_factory.cpp index 52df1f8..022d1c9 100644 --- a/services/native/src/thermal_observer/state_machine/state_collection_factory.cpp +++ b/services/native/src/thermal_observer/state_machine/state_collection_factory.cpp @@ -31,7 +31,7 @@ std::shared_ptr StateCollectionFactory::Create(std::string &st return std::make_shared(); } else if (stateName == STATE_SCREEN) { return std::make_shared(); - } else if (stateName == STATE_SCNEN) { + } else if (stateName == STATE_SCENE) { return std::make_shared(); } else { return std::make_shared(stateName); diff --git a/services/native/src/thermal_observer/thermal_sensor_info.cpp b/services/native/src/thermal_observer/thermal_sensor_info.cpp index 210fa88..3745b40 100644 --- a/services/native/src/thermal_observer/thermal_sensor_info.cpp +++ b/services/native/src/thermal_observer/thermal_sensor_info.cpp @@ -58,4 +58,4 @@ void ThermalSensorInfo::NotifyObserver() tms->GetObserver()->OnReceivedSensorInfo(GetTypeTempMap()); } } // PowerMgr -} // OHOS \ No newline at end of file +} // OHOS diff --git a/services/native/src/thermal_policy/thermal_config_sensor_cluster.cpp b/services/native/src/thermal_policy/thermal_config_sensor_cluster.cpp index cf08a80..854e193 100644 --- a/services/native/src/thermal_policy/thermal_config_sensor_cluster.cpp +++ b/services/native/src/thermal_policy/thermal_config_sensor_cluster.cpp @@ -32,6 +32,10 @@ bool ThermalConfigSensorCluster::CheckStandard() THERMAL_HILOGE(COMP_SVC, "sensor info is empty"); return false; } + if (auxSensorInfolist_.empty()) { + THERMAL_HILOGE(COMP_SVC, "aux sensor info is empty"); + return false; + } uint32_t expectedLevSize = static_cast(sensorInfolist_.begin()->second.size()); for (auto sensorInfo = sensorInfolist_.begin(); sensorInfo != sensorInfolist_.end(); ++sensorInfo) { uint32_t actualLevSize = static_cast(sensorInfo->second.size()); diff --git a/utils/native/include/constants.h b/utils/native/include/constants.h index c39c3a9..ba7ce38 100644 --- a/utils/native/include/constants.h +++ b/utils/native/include/constants.h @@ -44,7 +44,7 @@ namespace PowerMgr { // state name const std::string STATE_CHARGER = "charge"; const std::string STATE_SCREEN = "screen"; - const std::string STATE_SCNEN = "scene"; + const std::string STATE_SCENE = "scene"; // scene sensor name const std::string BATTERY = "battery"; -- Gitee