diff --git a/bundle.json b/bundle.json old mode 100755 new mode 100644 diff --git a/services/BUILD.gn b/services/BUILD.gn index 1a390a41a3ef32b3658268d0b42f78fc7e55196f..554400b3275553aa6f33330bc0218658c559b0bd 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -122,6 +122,7 @@ ohos_shared_library("thermalservice") { "device_driver_framework:libhdf_utils", "device_driver_framework:libhdi", "eventhandler:libeventhandler", + "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "multimedia_image_standard:image_native", diff --git a/services/native/src/thermal_action/action/action_thermal_level.cpp b/services/native/src/thermal_action/action/action_thermal_level.cpp index b7366a4247da4b2f3b2a6b68766cd783012335e9..1513b54040ce405165eedae7f27a155d97aa6a95 100644 --- a/services/native/src/thermal_action/action/action_thermal_level.cpp +++ b/services/native/src/thermal_action/action/action_thermal_level.cpp @@ -18,12 +18,14 @@ #include #include #include +#include #include "constants.h" #include "thermal_service.h" #include "thermal_common.h" using namespace OHOS::AAFwk; using namespace OHOS::EventFwk; +using namespace OHOS::HiviewDFX; namespace OHOS { namespace PowerMgr { @@ -194,6 +196,10 @@ void ActionThermalLevel::NotifyThermalLevelChanged(int32_t level) for (auto& listener : thermalLevelListeners_) { listener->GetThermalLevel(static_cast(level_)); } + + // Notify thermal level change event to battery statistics + HiSysEvent::Write(HiSysEvent::Domain::POWERMGR, "THERMAL_LEVEL_CHANGED", HiSysEvent::EventType::STATISTIC, "level", + level); } /** @@ -275,4 +281,4 @@ void ActionThermalLevel::SendThermalLevelEvents(int32_t level) } } } // namespace PowerMgr -} // namespace OHOS \ No newline at end of file +} // namespace OHOS