From e7634ea26f7f08727b6391f008802e802a99ca67 Mon Sep 17 00:00:00 2001 From: q00569459 Date: Mon, 17 Jan 2022 12:42:29 +0800 Subject: [PATCH 1/2] Thermal event Signed-off-by: q00569459 --- frameworks/native/src/common_event_support.cpp | 6 ++++++ interfaces/innerkits/native/include/common_event_support.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/frameworks/native/src/common_event_support.cpp b/frameworks/native/src/common_event_support.cpp index 9a65f4b0..b112f30b 100644 --- a/frameworks/native/src/common_event_support.cpp +++ b/frameworks/native/src/common_event_support.cpp @@ -71,6 +71,11 @@ const std::string CommonEventSupport::COMMON_EVENT_POWER_DISCONNECTED = "usual.e * This common event can only be published by the system. */ const std::string CommonEventSupport::COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF"; +/** + * Indicate the action of a common event that the thermal level changed. + * This common event can only be published by the system. + */ +const std::string CommonEventSupport::COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.LEVEL_CHANGED"; /** * Indicate the action of a common event that the device screen is on and the device is interactive. * This common event can only be published by the system. @@ -1062,6 +1067,7 @@ void CommonEventSupport::Init() commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_SCREEN_OFF); commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_SCREEN_ON); + commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_THERMAL_LEVEL_CHANGED); commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_USER_PRESENT); commonEventSupport_.emplace_back(CommonEventSupport::COMMON_EVENT_TIME_TICK); diff --git a/interfaces/innerkits/native/include/common_event_support.h b/interfaces/innerkits/native/include/common_event_support.h index 136b0c5f..e329089c 100644 --- a/interfaces/innerkits/native/include/common_event_support.h +++ b/interfaces/innerkits/native/include/common_event_support.h @@ -81,6 +81,11 @@ public: * This common event can only be published by the system. */ static const std::string COMMON_EVENT_SCREEN_ON; + /** + * Indicate the action of a common event that the thermal level changed. + * This common event can only be published by the system. + */ + static const std::string COMMON_EVENT_THERMAL_LEVEL_CHANGED; /** * Indicate the action of a common event that the user unlocks the device. * This common event can only be published by the system. -- Gitee From ae1627e47361247550e6f4f8016253890eb6c187 Mon Sep 17 00:00:00 2001 From: q00569459 Date: Mon, 17 Jan 2022 12:44:34 +0800 Subject: [PATCH 2/2] Thermal event Signed-off-by: q00569459 --- frameworks/native/src/common_event_support.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frameworks/native/src/common_event_support.cpp b/frameworks/native/src/common_event_support.cpp index b112f30b..51cd26e4 100644 --- a/frameworks/native/src/common_event_support.cpp +++ b/frameworks/native/src/common_event_support.cpp @@ -72,15 +72,15 @@ const std::string CommonEventSupport::COMMON_EVENT_POWER_DISCONNECTED = "usual.e */ const std::string CommonEventSupport::COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF"; /** - * Indicate the action of a common event that the thermal level changed. + * Indicate the action of a common event that the device screen is on and the device is interactive. * This common event can only be published by the system. */ -const std::string CommonEventSupport::COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.LEVEL_CHANGED"; +const std::string CommonEventSupport::COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON"; /** - * Indicate the action of a common event that the device screen is on and the device is interactive. + * Indicate the action of a common event that the thermal level changed. * This common event can only be published by the system. */ -const std::string CommonEventSupport::COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON"; +const std::string CommonEventSupport::COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.LEVEL_CHANGED"; /** * Indicate the action of a common event that the user unlocks the device. * This common event can only be published by the system. -- Gitee