From: Caisking <3449750381@qq.com> Date: Fri, 10 May 2024 03:00:38 +0000 (+0800) Subject: UI同步省电模式接口 X-Git-Tag: release_V1.2.70_20241020_135402~1025^2~8^2^2~2 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=a814a8b87e39c697526e2cc869cfd92cc9a47257;p=mirrors%2FFD230.git UI同步省电模式接口 --- diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index 4af701a30..bdf9bf9dc 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -109,6 +109,7 @@ set(PRIVATE_HEADER ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/cywee/ + ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/utils/ ${ROOT_DIR}/open_source/openharmony/foundation/distributedschedule/samgr_lite/interfaces/kits/samgr ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/include/dial diff --git a/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp b/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp index b9ed27711..229ca204a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp @@ -24,6 +24,14 @@ #include #include "battery_hal.h" #include "string" +#include "custom_utils.h" + +extern "C" +{ + void uapi_exit_power_saving_mode(void); + void uapi_enter_power_saving_mode(void); +} + namespace OHOS { static SaveBatView *g_pSaveBatView{nullptr}; @@ -34,11 +42,15 @@ namespace OHOS } SaveBatView::SaveBatView() { + /*开启省电模式*/ + uapi_enter_power_saving_mode(); g_pSaveBatView = this; } SaveBatView::~SaveBatView() { + /*关闭省电模式*/ + uapi_exit_power_saving_mode(); DeInit(); g_pSaveBatView = nullptr; } diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 4162387e7..12219fbf1 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -1697,6 +1697,7 @@ uint32_t custom_i2c_resume(void) return 0; } +/*省电模式*/ void uapi_enter_power_saving_mode(void) { PRINT("Enter Power Saving Mode !!! \r\n"); diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index c8090381b..66d685a90 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -166,6 +166,9 @@ void uapi_get_sleeping_data(void); void cywee_get_id(void); int custom_exit_lpm(void); +void uapi_exit_power_saving_mode(void); +void uapi_enter_power_saving_mode(void); + #ifdef __cplusplus }