From: hcj <1224667075@qq.com> Date: Sat, 29 Jun 2024 06:49:06 +0000 (+0800) Subject: 更改低电量报警 X-Git-Tag: release_V1.2.70_20241020_135402~895^2~15 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=4e34ce605c9226b6b1c8d60503c301218868f089;p=mirrors%2FFD230.git 更改低电量报警 --- 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();