From 5b611041af2405f86375176bbc89afa48b4b5029 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 15 Oct 2024 15:55:57 +0800 Subject: [PATCH] =?utf8?q?1.=E5=A2=9E=E5=8A=A0=E5=B8=B8=E4=BA=AE=E5=B1=8Fr?= =?utf8?q?untime=EF=BC=8C=E8=A7=A3=E5=86=B3=E9=95=BF=E4=BA=AE=E5=B1=8F?= =?utf8?q?=E7=95=8C=E9=9D=A2=E8=A2=AB=E5=BC=B9=E7=AA=97=E5=8F=96=E6=B6=88?= =?utf8?q?=E5=B8=B8=E4=BA=AE=E5=B1=8F=202.#697=EF=BC=8C=E8=A7=A3=E5=86=B3?= =?utf8?q?=EF=BC=8C=E6=89=8B=E8=A1=A8=E5=BC=80=E6=9C=BA=E5=92=8C=E5=85=B3?= =?utf8?q?=E6=9C=BA=E6=97=B6=E5=A2=9E=E5=8A=A0=E9=9C=87=E5=8A=A8(=E9=9C=80?= =?utf8?q?=E6=B1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativelauncher/src/NativeLauncher.cpp | 4 ++++ .../fd230app/nativeui/uiservice/src/ui_service.cpp | 6 ++++++ code/sdk/drivers/peripheral/utils/custom_runtime.c | 10 ++++++++++ code/sdk/drivers/peripheral/utils/custom_runtime.h | 4 ++++ code/sdk/drivers/peripheral/utils/custom_utils.c | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 1677ffccc..f6ac1c799 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -300,6 +300,7 @@ extern "C" uint8_t uapi_dev_runtime_get_lock_status(void); #endif #include "bleEvent.h" #include "../../../../../../drivers/peripheral/config/include/ConfigModelC.h" +#include "vibrator_service.h" namespace OHOS { @@ -566,6 +567,9 @@ namespace OHOS OHOS::MainModel::GetInstance().setDialState(OHOS::DialState::LOCK, true); } } + + // 开机增加震动 页面启动震动一次 + ui_api_vibrate_once_func(); } // 注册开机时间 SystemLogData systemlog; diff --git a/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp b/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp index af8badfff..1da28338c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp @@ -56,6 +56,7 @@ #include "ui_serviceC.h" #include "languagecode/include/LanguageSwitchModel.h" +#include "custom_runtime.h" extern "C" errcode_t uapi_pm_add_sleep_veto(pm_id_t veto_id); extern "C" errcode_t uapi_pm_remove_sleep_veto(pm_id_t veto_id); @@ -204,6 +205,11 @@ extern "C" { return; } + if(uapi_dev_runtime_get_screen_always_on_status() == 1) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[ScreenTurnOff] screen is always on not can turn off"); + return; + } #if defined(SUPPORT_POWER_MANAGER) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScreenTurnOff] timeout auto"); set_back_to_home_interval(g_interval); diff --git a/code/sdk/drivers/peripheral/utils/custom_runtime.c b/code/sdk/drivers/peripheral/utils/custom_runtime.c index 50c068595..4a8c2315f 100644 --- a/code/sdk/drivers/peripheral/utils/custom_runtime.c +++ b/code/sdk/drivers/peripheral/utils/custom_runtime.c @@ -99,6 +99,7 @@ typedef struct uint8_t respiratory_training_status; //呼吸训练开始状态 uint8_t heartrate_detect_status;//主动检测心率状态 uint8_t factory_test_status;//产测模式状态 + uint8_t screen_always_on_status;//屏幕是否常亮状态 } runtime_status_t; @@ -430,6 +431,15 @@ uint8_t uapi_dev_runtime_get_respiratory_training_status(void) return g_runtime.respiratory_training_status; } +//设置是否常亮状态 +void uapi_dev_runtime_set_screen_always_on_status(uint8_t status) +{ + g_runtime.screen_always_on_status = status; +} +uint8_t uapi_dev_runtime_get_screen_always_on_status(void) +{ + return g_runtime.screen_always_on_status; +} // sleep mode flag void uapi_sleep_mode_flag_set(uint8_t flag) { diff --git a/code/sdk/drivers/peripheral/utils/custom_runtime.h b/code/sdk/drivers/peripheral/utils/custom_runtime.h index ef2b6cb3c..39ef46455 100644 --- a/code/sdk/drivers/peripheral/utils/custom_runtime.h +++ b/code/sdk/drivers/peripheral/utils/custom_runtime.h @@ -174,6 +174,10 @@ uint8_t uapi_dev_runtime_get_motion_recognition_status(void); //呼吸训练 void uapi_dev_runtime_set_respiratory_training_status(uint8_t status); uint8_t uapi_dev_runtime_get_respiratory_training_status(void); + +//设置屏幕是否常亮 +void uapi_dev_runtime_set_screen_always_on_status(uint8_t status); +uint8_t uapi_dev_runtime_get_screen_always_on_status(void); /***************************************cat1 runtime 变量设置获取函数**************************************************/ diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index bc0e0f7cd..d0f2fdf51 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -1101,12 +1101,18 @@ void ScreenAlwaysOnCtr(uint8_t turnOnFlag) { display_api->turn_on_screen(); } + + uapi_dev_runtime_set_screen_always_on_status(1); + //当设置的值是-1 的时候,设置屏幕常亮 display_api->set_screen_set_keepon_timeout(-1); s_screen_always_on = true; } else { + + uapi_dev_runtime_set_screen_always_on_status(0); + display_api->set_screen_set_keepon_timeout(0); s_screen_always_on = false; } -- 2.17.1