更改低电量报警 416/3
authorhcj <1224667075@qq.com>
Sat, 29 Jun 2024 06:49:06 +0000 (14:49 +0800)
committerhcj <1224667075@qq.com>
Sat, 29 Jun 2024 06:49:06 +0000 (14:49 +0800)
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp

index af96aa7..820e8d3 100644 (file)
@@ -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();