优化震动提醒,优化设置页面选中英文后错误显示中文 3163/1 3163/head 3164/target/1
authorluozheng <1732036298@qq.com>
Sat, 31 Jan 2026 11:38:00 +0000 (19:38 +0800)
committerluozheng <1732036298@qq.com>
Sat, 31 Jan 2026 11:38:00 +0000 (19:38 +0800)
22 files changed:
code/sdk/application/wearable/fd272/nativeapp/nativelauncher/src/NativeLauncher.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/health/CheckAbnormalView.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/health/CheckInvalidView.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/record/src/RecordingModel.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/respiratorytraining/src/RespiratoryTrainingView.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/settings/src/SettingItemView.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/SoundAndVibrationVolumeSettingPresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/stress/src/stressTestModel.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingModel.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/notify/alarm_notification.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/notify/drinkReminder_notification.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/notify/findwatch_notification.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/notify/goal_notification.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/notify/message_notification.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/notify/motion_recognition_notification.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/notify/phone_crt.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/notify/sedentaryReminder_notification.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/notify/sleep_notification.cpp
code/sdk/zhihui/drivers/vibrator/service/vibrator_service.cpp

index a24d43f..01c336e 100644 (file)
@@ -172,9 +172,6 @@ void NativeLauncher::InitNativeLauncher(LaunchMode mode)
         // 初始化屏幕时长
         cm_initializeScreenDuration();
 
-        // 开机增加震动 页面启动震动一次
-        // custom_VibratorFunc_int(0);
-
         // 初始化压力测试
         StressTestModel::GetInstance().LoadResultFromFile();
     }
index 9bf9fdd..0ba9ac6 100644 (file)
@@ -184,8 +184,8 @@ namespace OHOS
         
         if(true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
         {
-            custom_VibratorFunc_int(5);
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
+            custom_VibratorFunc_int(0);
         }
 
         // 增加按键监听
index 77c9cc7..ced0832 100644 (file)
@@ -245,8 +245,8 @@ namespace OHOS
         if(true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
         {
             // 震动提醒
-            custom_VibratorFunc_int(5);
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
+            custom_VibratorFunc_int(0);
         }
 
         // 增加按键监听
index afe2f2a..4467c77 100644 (file)
@@ -197,8 +197,8 @@ bool VolumeSliderEventListener::OnRotateEnd(UIView& view, const RotateEvent& eve
         if (slider == progress)\r
         {\r
             ChangeVolume(VOLUMEDRAG);\r
-            custom_VibratorFunc_int(5);//受设置中震动强度控制\r
-            custom_VibratorFunc_int(5);//受设置中震动强度控制\r
+            custom_VibratorFunc_int(0);//受设置中震动强度控制\r
+            custom_VibratorFunc_int(0);//受设置中震动强度控制\r
         }\r
     }\r
     return true;\r
index 77f2f84..2247daa 100644 (file)
@@ -1122,7 +1122,7 @@ namespace OHOS
                 if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
                 {
                     // 震动提醒
-                    custom_VibratorFunc_int(5);
+                    custom_VibratorFunc_int(0);
                 }
                 RecordingPresenter::GetInstance()->StopRecord();  //  停止录制
                 RecordingPresenter::GetInstance()->showWarning(); // 显示警告
index 26b78a4..0586cde 100644 (file)
@@ -200,7 +200,7 @@ namespace OHOS
                     breath->SetTextId(STR_EXHALE_NOW);
                 }
                 // 震动提醒
-                custom_VibratorFunc_int(5);
+                custom_VibratorFunc_int(0);
                 breath->ForceResetText();
             }
         }
@@ -244,7 +244,7 @@ namespace OHOS
         StartRespiratoryTraining();                          // 开始呼吸训练
         HeartModel::GetInstance()->Heart_Control(HeartState::Start, HeartCheck::INITIATIVE); // 开启心率检测
         RespiratoryTrainingModel::GetInstance().RT_StartTimer(RespiratoryTrainingModel::GetInstance().GetRespiratoryTrainingTime()); // 开启定时器
-        custom_VibratorFunc_int(5);                                                                                                  // 震动
+        custom_VibratorFunc_int(0);                                                                                                  // 震动
     }
 
     bool RespiratoryTrainingView::OnClick(UIView &view, const ClickEvent &event)
@@ -481,7 +481,7 @@ namespace OHOS
         StartRespiratoryTraining();                                                          // 开始呼吸训练
         HeartModel::GetInstance()->Heart_Control(HeartState::Start, HeartCheck::INITIATIVE); // 开启心率检测
         RespiratoryTrainingModel::GetInstance().RT_StartTimer(ONE_MIN);                      // 开启一个一分钟的定时器
-        custom_VibratorFunc_int(5);                                                          // 震动提醒
+        custom_VibratorFunc_int(0);                                                          // 震动提醒
 #endif
     }
 
index e567953..d2938da 100644 (file)
@@ -9,6 +9,7 @@
 #include "wearable_log.h"
 #include "settings/include/SettingItemView.h"
 #include "systemupdate/include/SystemUpdateModel.h"
+#include "ConfigModel.h"
 namespace OHOS
 {
     static constexpr int16_t SETTING_ICON_X = 19 + 43;
@@ -61,7 +62,12 @@ namespace OHOS
             settingLabelExt.SetVisible(true);
             settingLabelExt.SetPosition(SETTINGLABELEXT_X, SETTINGLABELEXT_Y, SETTINGLABELEXT_W, SETTINGLABELEXT_H);
             if(itemInfo.textId == STR_EPHEMERIS_DOWNLOAD){
-                settingLabelExt.SetText("定位优化");
+                if(ConfigModel::GetInstance()->GetLanguage() == 0){
+                    settingLabelExt.SetText("定位优化");
+                }
+                else{
+                    settingLabelExt.SetText("Positioning Optimization");
+                }
             }
             else{
                 settingLabelExt.SetTextId(itemInfo.textId);
@@ -87,7 +93,12 @@ namespace OHOS
             }
             settingLabelExt.SetPosition(SETTINGLABELEXT_X2, SETTINGLABELEXT_Y2, SETTINGLABELEXT_W2, SETTINGLABELEXT_H2);
            if(itemInfo.textId == STR_EPHEMERIS_DOWNLOAD){
-                settingLabelExt.SetText("定位优化");
+                if(ConfigModel::GetInstance()->GetLanguage() == 0){
+                    settingLabelExt.SetText("定位优化");
+                }
+                else{
+                    settingLabelExt.SetText("Positioning Optimization");
+                }
             }
             else{
                 settingLabelExt.SetTextId(itemInfo.textId);
index 783e52b..ef7f439 100644 (file)
@@ -133,7 +133,6 @@ namespace OHOS
             int VibrationMode = view_->GetVibrationModeView()->GetVibrationModePicker()->GetSelected();\r
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VibrationMode = %d", VibrationMode);\r
             SoundAndVibrationModel::GetInstance()->SetVibrationReminderToggleButtonStaus(VibrationMode);\r
-            // uapi_vibrationModeSet(VibrationMode);\r
             custom_VibratorFunc_int(0);\r
             view_->ChangeView(VIBRATIONMODEVIEW, SOUNDANDVIBRATIONVIEW);\r
         }\r
index 2dbff69..03aa7e4 100644 (file)
@@ -204,7 +204,7 @@ namespace OHOS
     bool VoumeProcessSliderEventListener::OnRotateEnd(UIView& view, const RotateEvent& event)
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VoumeProcessSliderEventListener::OnRotateEnd,%d",event.GetRotate());
-        custom_VibratorFunc_int(5);//受设置中震动强度控制
+        custom_VibratorFunc_int(0);//受设置中震动强度控制
         return true;
     }
 }
index 8cb798a..5488fc4 100644 (file)
@@ -518,7 +518,7 @@ namespace OHOS
             StressTestModel::GetInstance().SetCurrentFailType(StressTestModel::FAIL_TYPE_INVALID_DATA);
             StressTest_StopTimer();
             // 震动提醒
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
             // 亮屏
             uapi_set_screen_on_api();
             // 切换到失败页面
@@ -579,7 +579,7 @@ namespace OHOS
             // 停止压力测试
             StressTest_StopTimer();
             // 震动
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
             // 亮屏
             uapi_set_screen_on_api();
             return;
@@ -591,7 +591,7 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "压力测试: 有效数据不足 ringBufferIndex:%d", ringBufferIndex);
             StressTestModel::GetInstance().SetCurrentFailType(StressTestModel::FAIL_TYPE_INVALID_DATA);
             // 震动提醒
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
             // 停止压力测试
             StressTest_StopTimer();
             // 切换到失败页面
@@ -616,7 +616,7 @@ namespace OHOS
             StressTestModel::GetInstance().SetCurrentFailType(StressTestModel::FAIL_TYPE_NOT_WORN);
             StressTest_StopTimer();
             // 震动提醒
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
             // 切换到失败页面
             if (StressTestPresenter::GetInstance())
             {
index 96e3bfc..b9e20e0 100644 (file)
      uapi_set_screen_on_api(); // 亮屏检测
      if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() &&
          (!uapi_sleep_mode_flag_get())) {
-       custom_VibratorFunc_int(5);
-       custom_VibratorFunc_int(5);
+       custom_VibratorFunc_int(0);
+       custom_VibratorFunc_int(0);
      }
      if (TraingCardView::GetInstance()) {
        GraphicService::GetInstance()->PostGraphicEvent(
@@ -1286,8 +1286,8 @@ void TraingModel::SetSportdata(SportData *data) {
        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "目标完成");
        uapi_set_screen_on_api(); // 亮屏检测
        if (!OHOS::ConfigModel::GetInstance()->GetDnotdisturb()) {
-         custom_VibratorFunc_int(5); // 震动提示
-         custom_VibratorFunc_int(5); // 震动提示
+         custom_VibratorFunc_int(0); // 震动提示
+         custom_VibratorFunc_int(0); // 震动提示
        }
        if (TraingCardView::GetInstance()) {
          GraphicService::GetInstance()->PostGraphicEvent(
@@ -1312,8 +1312,8 @@ void TraingModel::SetSportdata(SportData *data) {
      WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "目标完成");
      uapi_set_screen_on_api(); // 亮屏检测
      if (!OHOS::ConfigModel::GetInstance()->GetDnotdisturb()) {
-       custom_VibratorFunc_int(5); // 震动提示
-       custom_VibratorFunc_int(5); // 震动提示
+       custom_VibratorFunc_int(0); // 震动提示
+       custom_VibratorFunc_int(0); // 震动提示
      }
      if (TraingCardView::GetInstance()) {
        GraphicService::GetInstance()->PostGraphicEvent(
@@ -1952,8 +1952,8 @@ bool TraingModel::GetMomentum() {
    // 振动反馈
    if ((sportdata->goaldegree >= 100) && (shock_count < 4)) {
      shock_count++;
-     custom_VibratorFunc_int(5); // 触发振动反馈
-     custom_VibratorFunc_int(5);
+     custom_VibratorFunc_int(0); // 触发振动反馈
+     custom_VibratorFunc_int(0);
      WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "触发了振动。振动计数: %d",
                    shock_count);
    }
index fcca683..1fe7dd1 100644 (file)
      {TOPIC_EVENT_INACTIVITY_UPDATE,       MsgCenterNotifyInactivityProc},
      // {TOPIC_EVENT_INACTIVITY_ACCUMULATE_TIME_UPDATE,       MsgCenterNotifyInactivityAccumulateTimeProc},
  #endif
-     // {TOPIC_EVENT_GOAL_SHOW_VIEW,    MsgCenterNotifygoalnotificationviewProc},//编译不过
+     {TOPIC_EVENT_GOAL_SHOW_VIEW,    MsgCenterNotifygoalnotificationviewProc},
      {TOPIC_EVENT_BLE_TRANSMIT,       MsgCenterNotifybleTransmit},
  
      {TOPIC_EVENT_CHARGE_PLUG,        MsgCenterNotifyChargePlugProc},
index eaa7454..ffdc01b 100644 (file)
@@ -118,7 +118,7 @@ namespace OHOS
             // }\r
             if (g_alarmView)\r
             {\r
-                custom_VibratorFunc_int(5);\r
+                custom_VibratorFunc_int(0);\r
             }\r
         }\r
     }\r
index 8f3781b..69a3e4d 100644 (file)
@@ -99,9 +99,8 @@ namespace OHOS
         uapi_set_screen_on_api();
         if (true != ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
         {
-            // uapi_vibrationModeSet(ConfigModel::GetInstance()->GetVibrationReminder());
-            custom_VibratorFunc_int(5);
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
+            custom_VibratorFunc_int(0);
         }
     }
 
@@ -252,8 +251,8 @@ namespace OHOS
             /* -------------------------------------------------------------------------- */
             if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
             {
-                custom_VibratorFunc_int(5); // 震动一次
-                custom_VibratorFunc_int(5); // 震动一次
+                custom_VibratorFunc_int(0); // 震动一次
+                custom_VibratorFunc_int(0); // 震动一次
             }
 
             ScreenTurnOn(10 * 1000); // 亮屏操作  10秒关闭
index 453f6e8..f8effa3 100644 (file)
@@ -106,7 +106,7 @@ namespace OHOS
     {
         if (nullptr != FindWatchGroupView)
         {
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
         }
     }
 
index ced2cda..2d9870f 100644 (file)
@@ -303,8 +303,8 @@ namespace OHOS
         {
             if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
             {
-                custom_VibratorFunc_int(5);
-                custom_VibratorFunc_int(5);
+                custom_VibratorFunc_int(0);
+                custom_VibratorFunc_int(0);
             }
         }
         if (GoalviewShowCallBack_FALG == 0)
index 466b5e0..4a87eb6 100644 (file)
@@ -273,8 +273,8 @@ namespace OHOS
             (!uapi_sleep_mode_flag_get()))
         {
             // 震动提醒
-            custom_VibratorFunc_int(5);
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
+            custom_VibratorFunc_int(0);
         }
 
         MessageViewEventListener::GetInstance()
index cdfc894..37cab10 100644 (file)
@@ -352,8 +352,8 @@ namespace OHOS
         // 震动一次
         if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
         {
-            custom_VibratorFunc_int(5);
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
+            custom_VibratorFunc_int(0);
         }
         /* -------------------------------------------------------------------------- */
         NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeMotionRecognitionView);
index 0163402..ce93cf5 100644 (file)
@@ -863,7 +863,7 @@ void phone_VibratorFunc(void)
 {
     if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
     {
-        custom_VibratorFunc_int(5);
+        custom_VibratorFunc_int(0);
     }
 }
  
index 5ccc2b2..b0587a7 100644 (file)
@@ -288,8 +288,8 @@ namespace OHOS
         ScreenTurnOn(10 * 1000); // 显示时长10s
         if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
         {
-            custom_VibratorFunc_int(5);
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
+            custom_VibratorFunc_int(0);
         }
         /* -------------------------------------------------------------------------- */
         NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeSedentaryReminderView);
index 7450bbc..48b658e 100644 (file)
@@ -161,8 +161,8 @@ namespace OHOS
 
         if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
         {
-            custom_VibratorFunc_int(5);
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
+            custom_VibratorFunc_int(0);
         }
 
         ScreenTurnOn(100000); // 亮屏操作 100000ms 10秒关闭
@@ -208,8 +208,8 @@ namespace OHOS
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Create SleepGroupView succeed!!");
         if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
         {
-            custom_VibratorFunc_int(5);
-            custom_VibratorFunc_int(5);
+            custom_VibratorFunc_int(0);
+            custom_VibratorFunc_int(0);
         }
 
         ScreenTurnOn(600000); // 亮屏操作 600000ms 60秒关闭
index 698f26e..ca898ba 100644 (file)
@@ -54,7 +54,7 @@ void custom_VibratorFunc_int(int vibratorType)
     vibrator_cmd_t mail = {0};
     if(vibratorType == 4)
         vibmod = 4;
-    else if(vibratorType == 5)
+    else if(vibratorType == 5 || vibmod == 3)
         vibmod = 5;
     switch (vibmod)
     {