1.目标提醒弹窗加震动
authorluozheng <1732036298@qq.com>
Thu, 17 Oct 2024 03:49:22 +0000 (11:49 +0800)
committerluozheng <1732036298@qq.com>
Thu, 17 Oct 2024 03:49:22 +0000 (11:49 +0800)
2.运动识别和久坐提醒震动增加受勿扰和睡眠模式开关影响
3.修改默认震动强度为中

code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp
code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp
code/sdk/application/wearable/service/msg_center/src/notify/motion_recognition_notification.cpp
code/sdk/application/wearable/service/msg_center/src/notify/sedentaryReminder_notification.cpp
code/sdk/drivers/peripheral/config/include/ConfigModel.h

index 29bcc4f..cd5b8a0 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com\r
  * @Date: 2024-02-19 10:39:11\r
  * @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-09-14 18:28:58\r
+ * @LastEditTime: 2024-10-17 11:10:22\r
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp\r
  */\r
 \r
@@ -136,7 +136,7 @@ namespace OHOS
         else if ((view_->GetVibrationModeView() != nullptr) && (&view == view_->GetVibrationModeView()->GetVibrationModeLabelButton()))\r
         {\r
             int VibrationMode = view_->GetVibrationModeView()->GetVibrationModePicker()->GetSelected();\r
-            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VibrationMode = %d", VibrationMode);\r
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VibrationMode = %d", VibrationMode);\r
             SoundAndVibrationModel::GetInstance()->SetVibrationReminderToggleButtonStaus(VibrationMode);\r
             // uapi_vibrationModeSet(VibrationMode);\r
             ui_api_vibrate_once_func();\r
index 81c82ba..eca7931 100644 (file)
@@ -17,6 +17,8 @@
 #include "ConfigModel.h"
 
 #include "upg.h"
+#include "custom_runtime.h"
+#include "vibrator_service.h"
 namespace OHOS
 {
 
@@ -235,6 +237,13 @@ namespace OHOS
 
     UIViewGroup *GoalviewShow()
     {
+        // 震动一次
+        if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
+        {
+            ui_api_vibrate_once_func();
+        }
+
+
         if (getView == nullptr) {
             getView = new UIScrollView();
              getView->SetPosition(0, 0);
index 3a7908f..f77ec5a 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-08-17 16:44:20
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-09-29 14:36:18
+ * @LastEditTime: 2024-10-17 11:21:57
  * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/motion_recognition_notification.cpp
  */
 #include "notification_manager.h"
@@ -21,6 +21,7 @@
 #include "traing/include/TraingModel.h"
 #include "ui_service.h"
 #include "vibrator_service.h"
+#include "custom_runtime.h"
 namespace OHOS
 {
 
@@ -333,7 +334,11 @@ namespace OHOS
         }
         /* -------------------------------------------------------------------------- */
         ScreenTurnOn(10*1000);//显示时长10s
-        ui_api_vibrate_once_func();
+        // 震动一次
+        if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
+        {
+            ui_api_vibrate_once_func();
+        }
         /* -------------------------------------------------------------------------- */
         NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeMotionRecognitionView);
         return MotionRecognitionGroupView;
index 7e493f7..969ed2e 100644 (file)
@@ -15,6 +15,7 @@
 #include "ConfigModel.h"
 #include <ui_service.h>
 #include "vibrator_service.h"
+#include "custom_runtime.h"
 
 namespace OHOS
 {
@@ -273,7 +274,10 @@ namespace OHOS
         }
         /* -------------------------------------------------------------------------- */
         ScreenTurnOn(10 * 1000); // 显示时长10s
-        ui_api_vibrate_once_func();
+        if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
+        {
+            ui_api_vibrate_once_func();
+        }
         /* -------------------------------------------------------------------------- */
         NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeSedentaryReminderView);
         return SedentaryReminderGroupView;
index c0bf2fb..47e6dfa 100644 (file)
@@ -51,7 +51,7 @@ namespace OHOS
             CONFIGMODEL_ITEM_LANGUAGE_CODE,                       //语言Code string "zh","en"
             CONFIGMODEL_ITEM_TIMEZONE,                          //单位刻钟  默认+8 小时 = 8*4 = 32 刻钟
             CONFIGMODEL_ITEM_SILENT_MODE,                       //静音模式模式
-            CONFIGMODEL_ITEM_VIBRATOR_SWITCH,                   // 马达 开关,0 强,1 中,2 弱,3 关
+            CONFIGMODEL_ITEM_VIBRATOR_SWITCH,                   // 马达 开关,3 强,2 中,1 弱,0 关
             CONFIGMODEL_ITEM_RAISE_TO_WAKE,                 //抬腕亮屏开关
             CONFIGMODEL_ITEM_ACTIVITY_VALUES_STEPCOUNT,      //活动数据步数
             CONFIGMODEL_ITEM_ACTIVITY_VALUES_CALORIES,      //活动数据卡路里,
@@ -317,7 +317,7 @@ namespace OHOS
             {ConfigDataType::DATATYPE_STRING,  "language_code",             "zh"      },//CONFIGMODEL_ITEM_LANGUAGE_CODE, //默认没有选择语言
             {ConfigDataType::DATATYPE_INT,     "timezone",                 "32"      },//CONFIGMODEL_ITEM_TIMEZONE, //单位刻钟  默认+8 小时 = 4*8 = 32 刻钟
             {ConfigDataType::DATATYPE_BOOL,    "slient_mode",               "false" },//CONFIGMODEL_ITEM_SILENT_MODE,
-            {ConfigDataType::DATATYPE_INT,     "vibrator_switch",           "1"     },//CONFIGMODEL_ITEM_VIBRATOR_SWITCH, // 马达 开关,0 强,1 中,2 弱,3 关
+            {ConfigDataType::DATATYPE_INT,     "vibrator_switch",           "2"     },//CONFIGMODEL_ITEM_VIBRATOR_SWITCH, // 马达 开关,3 强,2 中,1 弱,0 关
             {ConfigDataType::DATATYPE_BOOL,    "rase2wake",                "true"  },//CONFIGMODEL_ITEM_RAISE_TO_WAKE,
             {ConfigDataType::DATATYPE_INT,     "stepcount",                "0"     },//CONFIGMODEL_ITEM_ACTIVITY_VALUES_STEPCOUNT,      //活动数据步数
             {ConfigDataType::DATATYPE_INT,     "calories",                 "0"     },// CONFIGMODEL_ITEM_ACTIVITY_VALUES_CALORIES,      //活动数据卡路里,