低电量关机(补)
authorxue <2144439972@qq.com>
Sun, 2 Nov 2025 07:55:48 +0000 (15:55 +0800)
committerxue <2144439972@qq.com>
Sun, 2 Nov 2025 07:55:48 +0000 (15:55 +0800)
code/sdk/application/wearable/ln/service/msg_center/src/msg_center_customer.cpp

index b923914..c995e78 100644 (file)
@@ -392,62 +392,49 @@ void MsgCenterNotifyLowpowerProc(const Topic topic, Request* req)
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyLowpowerProc: display_api function pointers are invalid");
         return;
     }
- 
-    if(alarm_type == 3)
+    if(alarm_type == 0)
     {
-        if (display_api->get_screen_state() != SCREEN_ON)
+        //提醒低电充电
+         if (display_api->get_screen_state() != SCREEN_ON)
         {   
             display_api->turn_on_screen();  
         }
-        display_api->set_screen_set_keepon_timeout(1000*5);
-        // 切换到提醒界面
+        display_api->set_screen_set_keepon_timeout(1000*2);
+
         ThunderBirdMainView *mainView = ThunderBirdMainView::GetInstance();
         if (mainView != nullptr) {
-            ThunderBirdModel::GetInstance()->StartReminderHideTimer(5000);
+            ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000);
             mainView->ChangeThunderBirdReminderView(THUNDERBIRD_REMINDERVIEW); // 不走ChangeView
             ThunderBirdReminderView *reminderView = ThunderBirdReminderView::GetInstance();
             if (reminderView != nullptr)
             {
-                reminderView->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CLOSE_BATTERY);
+                reminderView->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_LOW_BATTERY);
             }
         } else {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyLowpowerProc: ThunderBirdMainView::GetInstance() returned null");
         }
     }
-    else if(alarm_type == 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);  // TODO: 函数未实现,暂时注释
-        if (CheckPriority(topic))
-        {
-            NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
-            NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true);
-        }
-    }
     else
     {
-        //电量过低,直接提醒关机
         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);  // TODO: 函数未实现,暂时注释
-        if (NotificationManager::GetInstance()->HasNotifyShowing())
-        NotificationManager::GetInstance()->StopNotify();
-        if (CheckPriority(topic))
-        {
-        NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE);
-        NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true);
-        }
+        display_api->set_screen_set_keepon_timeout(1000*5);
+        // 切换到提醒界面
+        ThunderBirdMainView *mainView = ThunderBirdMainView::GetInstance();
+        if (mainView != nullptr) {
+            ThunderBirdModel::GetInstance()->StartReminderHideTimer(5000);
+            mainView->ChangeThunderBirdReminderView(THUNDERBIRD_REMINDERVIEW); // 不走ChangeView
+            ThunderBirdReminderView *reminderView = ThunderBirdReminderView::GetInstance();
+            if (reminderView != nullptr)
+            {
+                reminderView->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CLOSE_BATTERY);
+            }
+        } else {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyLowpowerProc: ThunderBirdMainView::GetInstance() returned null");
         }
+    }
     #else
     unused(topic);
     unused(req);