From dfe37fce658b3d19077d99722a6a019a9ca4b32e Mon Sep 17 00:00:00 2001 From: cheng Date: Tue, 20 Aug 2024 11:55:23 +0800 Subject: [PATCH] =?utf8?q?=E7=81=AD=E5=B1=8F=E4=BF=AE=E6=94=B9=E4=BA=AE?= =?utf8?q?=E5=BA=A6=E5=80=BC=EF=BC=9B=E7=9D=A1=E7=9C=A0=E6=A8=A1=E5=BC=8F?= =?utf8?q?=E4=B8=8B=E4=B8=8D=E5=B1=8F=E8=94=BD=E9=97=B9=E9=92=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/alarm/src/AlarmClockModel.cpp | 13 ++++++++----- .../service/msg_center/src/msg_center_customer.cpp | 5 +---- .../power_manager/src/power_display_service.c | 8 ++++++++ code/sdk/drivers/peripheral/lcd/soc_lcd_api.c | 8 ++++++++ code/sdk/drivers/peripheral/lcd/soc_lcd_api.h | 4 ++++ 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmClockModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmClockModel.cpp index f7f14adc6..f198658d2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmClockModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmClockModel.cpp @@ -20,6 +20,7 @@ #include "ui_service.h" #include "notification_manager.h" #include "../../../../../../../drivers/peripheral/config/include/ConfigModel.h" +#include "../../../../../../../drivers/peripheral/utils/custom_runtime.h" #ifdef __cplusplus extern "C" { @@ -691,13 +692,15 @@ void AlarmClockModel::PopInterCancelMusic() void AlarmClockModel::PopInterPlayMusic() { - ScreenTurnOn(-1); - - if(true != ConfigModel::GetInstance()->GetDnotdisturb()) + if(true == ConfigModel::GetInstance()->GetDnotdisturb() && (0 == uapi_dev_runtime_get_sleep_status())) { - GraphicService::GetInstance()->PostGraphicEvent( - std::bind(&AlarmClockModel::AlarmPlayerStart, AlarmClockModel::GetInstance())); + return; } + + ScreenTurnOn(-1); + + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&AlarmClockModel::AlarmPlayerStart, AlarmClockModel::GetInstance())); } void AlarmClockModel::SetSliceId() diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 2b05cd551..9a4c9aa86 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -722,10 +722,7 @@ void MsgCenterNotifySleepProc(const Topic topic, Request* req) if(SleepModel::GetInstance().get_sleep_state()==SLEEPSTATE::WAKE) { NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - if(true != ConfigModel::GetInstance()->GetDnotdisturb()) - { - SleepViewEventListener::GetInstance().PopInterPlayMusic(); - } + SleepViewEventListener::GetInstance().PopInterPlayMusic(); } else { diff --git a/code/sdk/application/wearable/service/power_manager/src/power_display_service.c b/code/sdk/application/wearable/service/power_manager/src/power_display_service.c index 20cbad943..10b582ee9 100755 --- a/code/sdk/application/wearable/service/power_manager/src/power_display_service.c +++ b/code/sdk/application/wearable/service/power_manager/src/power_display_service.c @@ -465,6 +465,14 @@ errcode_t power_display_set_brightness_handle(uint32_t message_type, uint32_t me unused(message_type); ext_errno ret = uapi_lcd_set_brightness(message_value); if (ret != 0) { + if(EXT_ERR_LCD_NOT_INIT == ret) + { + // 灭屏状态下 + POWER_DISPLAY_PRINT_ERR(0, "power_display_set_brightness in off screen mode"); + uapi_lcd_set_brightness_directly(message_value); + g_screen_context.brightness_value = message_value; + return ERRCODE_SUCC; + } POWER_DISPLAY_PRINT_ERR(0, "power_display_set_brightness fail, ret:%u.", ret); return ERRCODE_FAIL; } diff --git a/code/sdk/drivers/peripheral/lcd/soc_lcd_api.c b/code/sdk/drivers/peripheral/lcd/soc_lcd_api.c index 63f223555..f32bc030c 100644 --- a/code/sdk/drivers/peripheral/lcd/soc_lcd_api.c +++ b/code/sdk/drivers/peripheral/lcd/soc_lcd_api.c @@ -478,6 +478,14 @@ ext_errno uapi_lcd_set_brightness(uint16_t value) return EXT_ERR_SUCCESS; } +// read description in soc_lcd_api.h +ext_errno uapi_lcd_set_brightness_directly(uint16_t value) +{ + g_lcd_info.brightness = (uint8_t)value; + + return EXT_ERR_SUCCESS; +} + ext_errno uapi_lcd_get_brightness(uint16_t *value) { if (!g_lcd_info.is_inited) { diff --git a/code/sdk/drivers/peripheral/lcd/soc_lcd_api.h b/code/sdk/drivers/peripheral/lcd/soc_lcd_api.h index 0ae488eb0..1341d7da6 100644 --- a/code/sdk/drivers/peripheral/lcd/soc_lcd_api.h +++ b/code/sdk/drivers/peripheral/lcd/soc_lcd_api.h @@ -108,6 +108,10 @@ ext_errno uapi_lcd_te_off(void); ext_errno uapi_lcd_set_brightness(uint16_t value); +// 专用接口:灭屏状态下改变亮度值 +// 直接给变量 g_lcd_info.brightness 赋值 +ext_errno uapi_lcd_set_brightness_directly(uint16_t value); + ext_errno uapi_lcd_get_brightness(uint16_t *value); ext_errno uapi_lcd_write_reg(lcd_cmd_sequ *cmds, uint32_t cmd_count); -- 2.17.1