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);