From: luozheng <1732036298@qq.com> Date: Thu, 17 Oct 2024 03:49:22 +0000 (+0800) Subject: 1.目标提醒弹窗加震动 X-Git-Tag: release_V1.2.70_20241020_135402~5^2~17 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=c8c7dd6a71a52ce64d0d8298f8e5b12d58212cd7;p=mirrors%2FFD230.git 1.目标提醒弹窗加震动 2.运动识别和久坐提醒震动增加受勿扰和睡眠模式开关影响 3.修改默认震动强度为中 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp index 29bcc4f4d..cd5b8a08e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-02-19 10:39:11 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-14 18:28:58 + * @LastEditTime: 2024-10-17 11:10:22 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp */ @@ -136,7 +136,7 @@ namespace OHOS else if ((view_->GetVibrationModeView() != nullptr) && (&view == view_->GetVibrationModeView()->GetVibrationModeLabelButton())) { int VibrationMode = view_->GetVibrationModeView()->GetVibrationModePicker()->GetSelected(); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VibrationMode = %d", VibrationMode); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VibrationMode = %d", VibrationMode); SoundAndVibrationModel::GetInstance()->SetVibrationReminderToggleButtonStaus(VibrationMode); // uapi_vibrationModeSet(VibrationMode); ui_api_vibrate_once_func(); diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp index 81c82ba79..eca7931b9 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp @@ -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); diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/motion_recognition_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/motion_recognition_notification.cpp index 3a7908fb9..f77ec5a8e 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/motion_recognition_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/motion_recognition_notification.cpp @@ -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; 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 7e493f7b4..969ed2e27 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 @@ -15,6 +15,7 @@ #include "ConfigModel.h" #include #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; diff --git a/code/sdk/drivers/peripheral/config/include/ConfigModel.h b/code/sdk/drivers/peripheral/config/include/ConfigModel.h index c0bf2fb1b..47e6dfa46 100644 --- a/code/sdk/drivers/peripheral/config/include/ConfigModel.h +++ b/code/sdk/drivers/peripheral/config/include/ConfigModel.h @@ -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, //活动数据卡路里,