优化久坐提醒 703/4
authorluozheng <1732036298@qq.com>
Thu, 15 Aug 2024 08:54:43 +0000 (16:54 +0800)
committerluozheng <1732036298@qq.com>
Thu, 15 Aug 2024 08:54:43 +0000 (16:54 +0800)
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/service/msg_center/src/notify/sedentaryReminder_notification.cpp

index 1967f25..7fd301e 100644 (file)
@@ -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)
             {
index 004fa7a..5a28f09 100644 (file)
@@ -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);