From: cheng Date: Tue, 20 Aug 2024 03:55:23 +0000 (+0800) Subject: 灭屏修改亮度值;睡眠模式下不屏蔽闹钟 X-Git-Tag: release_V1.2.70_20241020_135402~609^2~11^2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F733%2F1;p=mirrors%2FFD230.git 灭屏修改亮度值;睡眠模式下不屏蔽闹钟 --- 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);