From 4e34ce605c9226b6b1c8d60503c301218868f089 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Sat, 29 Jun 2024 14:49:06 +0800 Subject: [PATCH] =?utf8?q?=20=E6=9B=B4=E6=94=B9=E4=BD=8E=E7=94=B5=E9=87=8F?= =?utf8?q?=E6=8A=A5=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../msg_center/src/msg_center_customer.cpp | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) 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 af96aa7f0..820e8d355 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 @@ -363,31 +363,39 @@ void MsgCenterNotifyLowPowerAlarmProc(const Topic topic, Request* req) //if(req->data); uint8 *x= (uint8 *)(req->data); const power_display_svr_api_t *display_api = power_display_svr_get_api(); - if (display_api->get_screen_state() != SCREEN_ON) - { - display_api->turn_on_screen(); - } - display_api->set_auto_timeout_function(1000*5); + if(*x==3) { + if (display_api->get_screen_state() != SCREEN_ON) + { + display_api->turn_on_screen(); + } + display_api->set_screen_set_keepon_timeout(1000*5); //倒计时结束后,直接执行关机动画 low_power_play(); } else if(*x==0) { //提醒低电充电 + if (display_api->get_screen_state() != SCREEN_ON) + { + display_api->turn_on_screen(); + } + display_api->set_screen_set_keepon_timeout(1000*5); + set_lowpower_falg(0); NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - - if (NotificationManager::GetInstance()->HasNotifyShowing()) - return; NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true); } else { //电量过低,直接提醒关机 - display_api->turn_on_screen(); - display_api->set_auto_timeout_function(1000*10); + if (display_api->get_screen_state() != SCREEN_ON) + { + display_api->turn_on_screen(); + } + display_api->set_screen_set_keepon_timeout(1000*10); + set_lowpower_falg(1); if (NotificationManager::GetInstance()->HasNotifyShowing()) NotificationManager::GetInstance()->StopNotify(); -- 2.17.1