#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" {
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()
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
{
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;
}
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) {
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);