From: xue <2144439972@qq.com> Date: Sun, 2 Nov 2025 07:55:48 +0000 (+0800) Subject: 低电量关机(补) X-Git-Tag: V1.0.9_20251128_194606_LN~130 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=75f5adfa621a824a34590f962f43b2b29f4a1339;p=mirrors%2FFD230.git 低电量关机(补) --- diff --git a/code/sdk/application/wearable/ln/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/ln/service/msg_center/src/msg_center_customer.cpp index b92391453..c995e78de 100644 --- a/code/sdk/application/wearable/ln/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/ln/service/msg_center/src/msg_center_customer.cpp @@ -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);