Merge #1209 into sdk602patch0911 from refs/changes/1209/head 1210/target/1
author罗正 <1732036298@qq.com>
Thu, 17 Oct 2024 08:10:34 +0000 (08:10 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Thu, 17 Oct 2024 08:10:34 +0000 (08:10 +0000)
Code review from 罗正

* refs/changes/1209/head: (4 commits squashed)

  - AI语音录音时间由15修改为10秒,10秒后超时自动发送录音数据

  - 1.目标提醒弹窗加震动
    2.运动识别和久坐提醒震动增加受勿扰和睡眠模式开关影响
    3.修改默认震动强度为中

  - Merge branch &#39;sdk602patch0911&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911

  - 修改KV Store 的Cache 大小为100

Signed-off-by: 罗正 <1732036298@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1209
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp
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
code/sdk/open_source/openharmony/utils/native/lite/include/utils_config.h

index b3bcdc6..f55bc2a 100644 (file)
@@ -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;
         }
     }
 
index 5753767..df62d02 100644 (file)
@@ -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();
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,      //活动数据卡路里,
index 09a78f7..0a1bb0c 100755 (executable)
@@ -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.