From b6087129f074d1f7b3e31958680e3f7e6ebaef69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Thu, 17 Oct 2024 08:10:34 +0000 Subject: [PATCH] Merge #1209 into sdk602patch0911 from refs/changes/1209/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/1209/head: (4 commits squashed) - AI语音录音时间由15修改为10秒,10秒后超时自动发送录音数据 - 1.目标提醒弹窗加震动 2.运动识别和久坐提醒震动增加受勿扰和睡眠模式开关影响 3.修改默认震动强度为中 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - 修改KV Store 的Cache 大小为100 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1209 --- .../fd230app/nativeui/aivoice/src/AiVoiceModel.cpp | 6 +++--- .../fd230app/nativeui/aivoice/src/AiVoiceView.cpp | 4 ++-- .../soundandvibration/src/SoundAndVibrationPresenter.cpp | 4 ++-- .../service/msg_center/src/notify/goal_notification.cpp | 9 +++++++++ .../src/notify/motion_recognition_notification.cpp | 9 +++++++-- .../src/notify/sedentaryReminder_notification.cpp | 6 +++++- code/sdk/drivers/peripheral/config/include/ConfigModel.h | 4 ++-- .../openharmony/utils/native/lite/include/utils_config.h | 2 +- 8 files changed, 31 insertions(+), 13 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp index b3bcdc60f..f55bc2aba 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:14:50 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-16 18:36:51 + * @LastEditTime: 2024-10-17 10:18:24 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp */ #include "aivoice/include/AiVoiceModel.h" @@ -792,7 +792,7 @@ namespace OHOS } static osTimerId_t g_listeningEndHandle = nullptr; - static uint8_t LISTENING_TIMEOUT = 15; // 15s钟无操作关闭该视图 + static uint8_t LISTENING_TIMEOUT = 10; // 10s钟无操作关闭该视图 static void AIListeningCallbackProc(int data) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AIListeningCallbackProc %d", LISTENING_TIMEOUT); @@ -871,7 +871,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "osTimerDelete failed, ret = %lx!!", ret); } g_listeningEndHandle = nullptr; - LISTENING_TIMEOUT = 15; + LISTENING_TIMEOUT = 10; } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp index 575376721..df62d0226 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-05-07 11:25:58 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-28 14:18:24 + * @LastEditTime: 2024-10-17 10:39:36 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp */ #include "aivoice/include/AiVoicePresenter.h" @@ -590,7 +590,7 @@ namespace OHOS } if(p_AivoiceListeningView) { - p_AivoiceListeningView->GetShowtimeoutLabel()->SetText("15"); + p_AivoiceListeningView->GetShowtimeoutLabel()->SetText("10"); p_AivoiceListeningView->GetShowtimeoutLabel()->Invalidate(); } AiVoiceModel::GetInstance().start_listening_timer(); 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, //活动数据卡路里, diff --git a/code/sdk/open_source/openharmony/utils/native/lite/include/utils_config.h b/code/sdk/open_source/openharmony/utils/native/lite/include/utils_config.h index 09a78f75c..0a1bb0cf5 100755 --- a/code/sdk/open_source/openharmony/utils/native/lite/include/utils_config.h +++ b/code/sdk/open_source/openharmony/utils/native/lite/include/utils_config.h @@ -52,7 +52,7 @@ * * Default value: 10 */ -#define MAX_CACHE_SIZE 10 +#define MAX_CACHE_SIZE 100 /** * @brief Indicates the number of data items that can be stored for each application. -- 2.17.1