灭屏修改亮度值;睡眠模式下不屏蔽闹钟 733/1 733/head 734/target/1 735/target/1
authorcheng <chengyf@zhihuishixun.com>
Tue, 20 Aug 2024 03:55:23 +0000 (11:55 +0800)
committercheng <chengyf@zhihuishixun.com>
Tue, 20 Aug 2024 03:55:23 +0000 (11:55 +0800)
code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmClockModel.cpp
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/service/power_manager/src/power_display_service.c
code/sdk/drivers/peripheral/lcd/soc_lcd_api.c
code/sdk/drivers/peripheral/lcd/soc_lcd_api.h

index f7f14ad..f198658 100644 (file)
@@ -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()
index 2b05cd5..9a4c9aa 100644 (file)
@@ -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
     {
index 20cbad9..10b582e 100755 (executable)
@@ -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;
     }
index 63f2235..f32bc03 100644 (file)
@@ -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) {
index 0ae488e..1341d7d 100644 (file)
@@ -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);