From: luozheng <1732036298@qq.com> Date: Thu, 15 Aug 2024 08:54:43 +0000 (+0800) Subject: 优化久坐提醒 X-Git-Tag: release_V1.2.70_20241020_135402~638^2~5^2~12 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=6bab4e34e906e1cc3142a7b8f46f36cc67d189f1;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 1967f25d3..7fd301ed7 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 @@ -1144,19 +1144,12 @@ void MsgCenterNotifyInactivityProc(const Topic topic, Request *req) WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "cywee_Inactivity_Info->output_number = %d", cywee_Inactivity_Info->output_number); - static int interval = 0;//久坐间隔时间 switch (cywee_Inactivity_Info->output_number) { case INACTIVITY_MODE_SEDENTARY_OUTPUT: if(cywee_Inactivity_Info->status == 1) { - //NotificationManager::GetInstance()->ShowNotify(showSedentaryReminderNotify, (uint16_t)topic, true); - //根据久坐间隔时间和是否在设置的提醒时间段内判断是否弹出久坐视图 - interval++; - if( interval % SedentaryReminderViewEventListener::GetInstance().GetIntervalTime() == 0){ - SedentaryReminderViewEventListener::GetInstance().SetSedentaryReminderNoteIntervalTime(interval); - NotificationManager::GetInstance()->ShowNotify(showSedentaryReminderNotify, (uint16_t)topic, true); - } + NotificationManager::GetInstance()->ShowNotify(showSedentaryReminderNotify, (uint16_t)topic, true); } else if(cywee_Inactivity_Info->status==9) { diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/sedentaryReminder_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/sedentaryReminder_notification.cpp index 004fa7a5a..5a28f093a 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/sedentaryReminder_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/sedentaryReminder_notification.cpp @@ -194,6 +194,7 @@ namespace OHOS SedentaryReminderNoteLabel->SetTextId(STR_SEDENTARY_REMINDER_NOTE); #endif // UpdateLabel(SedentaryReminderNoteLabel,"1",STR_SEDENTARY_REMINDER_NOTE); + SedentaryReminderViewEventListener::GetInstance().SetSedentaryReminderNoteIntervalTime(SedentaryReminderViewEventListener::GetInstance().GetIntervalTime()); SedentaryReminderNoteLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); SedentaryReminderNoteLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); SedentaryReminderNoteLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);