Merge #1256 into sdk602patch0911 from refs/changes/1256/head 1257/target/1 1258/target/1
author罗正 <1732036298@qq.com>
Thu, 24 Oct 2024 12:41:28 +0000 (12:41 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Thu, 24 Oct 2024 12:41:28 +0000 (12:41 +0000)
Code review from 罗正

* refs/changes/1256/head: (28 commits squashed)

  - 来电界面,禁止双击进入AI

  - 录音列表视图修改为右滑退出到录音主视图

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

  - 1.一个分区模式下修改音乐和录音文件夹
    2.录音添加空间判断管理
    3.录音添加”空间已满弹窗“:在总时长大于20分钟或总数大于等于99,录音总空间大于等于10M,弹出
    4.判断录音空间大小是否超出采用指令队列读职
    5.修改底层录音文件audio_capture_wrapper.cpp大小参数使之录取一个录音最长时间在20分钟左右

  - 修改音乐播放器函数名英文错误拼写

  - 如果手表在播放本地音乐,AI界面点击开始对话会暂停本地音乐播放,避免混音

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

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

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

  - 优化查找手表的播放音频逻辑

  - 修复录音播放完后等待一段时间再去点击录音播放,需要点击两次bug

  - 修复音乐播放器在切换到手机音乐无法调节音量bug

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

  - AI语音界面修改,提示将英文改为中文提醒

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

  - 实现AI答案恢复,列表同步滚动

  - 将power键;亮屏改为release触发

  - #477,系统更新界面提示,改成灰色透明弹窗提示,这个不显眼(需求)

  - 修改applist退出和进入统一动画,只有蜂窝才有

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

  - #1066,解决,手表端连续创建三个闹钟,再接着删除第二个闹钟,同步IOS APP成功,APP闹钟界面第三个闹钟显示为00:00(必现) bug
    #1065,解决APP创建5个闹钟后再删除一个,同步手表成功,手表端无法再新增闹钟(必现)

  - #1026,解决,天气显示不同,无法同步bug

  - 应用的按键监听改为释放退出

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

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

  - 根据客户要求修改:press亮屏,press退出应用,取消在applsit界面双击切换applist样式

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

  - #1060,解决,手表,AI全家桶偶尔点击1次继续对话,会有不灵敏的情况,需要点击第2次才能继续bug

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/1256
code/sdk/application/brandy/brandy_standard/input_app.c
code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp
code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp

index 6e582f9..9e6ebc0 100755 (executable)
@@ -200,16 +200,6 @@ void button_report_event(button_id_t id, event_button_t event)
 
     switch (event) {
         case BUTTON_PWR_PRESS:
-            // #ifdef SUPPORT_POWER_MANAGER
-            // if (!lcd_get_status()) {
-            //     button_report_event_to_pms();
-            //     return;
-            // }
-            // button_report_event_to_pms();
-            // #endif
-            button_report_event_to_gui(id, 1); // 1:press
-            break;
-        case BUTTON_PWR_CLICKUP:
             #ifdef SUPPORT_POWER_MANAGER
             if (!lcd_get_status()) {
                 button_report_event_to_pms();
@@ -217,6 +207,9 @@ void button_report_event(button_id_t id, event_button_t event)
             }
             button_report_event_to_pms();
             #endif
+            button_report_event_to_gui(id, 1); // 1:press
+            break;
+        case BUTTON_PWR_CLICKUP:
             button_report_event_to_gui(id, 0); // 0:release
             break;
         case BUTTON_PWR_LONGPRESS_3S:
index 6025767..106c4ec 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-06-20 14:44:22
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-23 11:22:25
+ * @LastEditTime: 2024-10-24 17:42:07
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h
  */
 #ifndef AI_VOICE_PRESENTER_H
@@ -57,6 +57,7 @@ namespace OHOS
 
     private:
         bool OnClick(UIView &view, const ClickEvent &event) override;
+        bool OnPress(UIView& view, const PressEvent& event) override;
         bool OnRelease(UIView &view, const ReleaseEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
         bool OnDragEnd(UIView &view, const DragEvent &event) override;
index 998281a..4f7a058 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-06-20 15:11:17
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-23 15:07:12
+ * @LastEditTime: 2024-10-24 18:35:43
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp
  */
 #include "AppViewIDs.h"
@@ -283,6 +283,39 @@ namespace OHOS
         return true;
     }
 
+    bool AiVoicePresenter::OnPress(UIView& view, const PressEvent& event)
+    {
+        UNUSED(event);
+        std::string viewId = view.GetViewId();
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnRelease %s", viewId.c_str());
+        /* ----------------------------- 重置60s取消常亮屏timer ---------------------------- */
+        model->reset_ai_screen60s_timer_time();
+        /* -------------------------------------------------------------------------- */
+        std::unordered_map<std::string, std::pair<int16_t, int16_t>> viewIdMap = {
+            {AIVOICERETURNRESULTTEXT_RETURN_BUTTON_VIEW_ID, {AIVOICE_RETURN_RESULT_TEXT_VIEWID, AIVOICE_STARTCHAT_VIEWID}},                        // 返回一级界面,并清除手表聊天记录
+            {AIVOICERETURNRESULTTEXT_CONTINUECHAT_BUTTON_VIEW_ID, {AIVOICE_RETURN_RESULT_TEXT_VIEWID, AIVOICE_LISTENING_VIEWID}},                  // 返回继续聆听,并清除手表聊天记录
+        };
+        auto it = viewIdMap.find(viewId);
+        if (it != viewIdMap.end())
+        {
+            if (it->first == AIVOICERETURNRESULTTEXT_CONTINUECHAT_BUTTON_VIEW_ID) // 点击继续对话按钮要发取消当前对话指令,避免AI回应中途按继续对话按钮没有取消上一次对话问题
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CancelCurAIChat");
+                AiVoiceModel::GetInstance().CancelCurAIChat();
+                PlayersModel::GetInstance()->HandPausePhoneMusic(); // 暂停手机音乐
+                PlayersModel::GetInstance()->PlayerPause();         // 暂停手机音乐
+            }
+            ChangeViewAndLogicOperator(it->second.first, it->second.second);
+            return true;
+        }
+        else
+        {
+            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Return false if viewId doesn't match any entry in the map");
+            return false;
+        }
+        return true;
+    }
+
     bool AiVoicePresenter::OnRelease(UIView &view, const ReleaseEvent &event)
     {
         UNUSED(event);
@@ -353,19 +386,19 @@ namespace OHOS
             {AIVOICECONNECTTIMEOUT_ENSURE_BUTTON_VIEW_ID, {AIVOICE_CONNECT_TIMEOUT_VIEWID, AIVOICE_STARTCHAT_VIEWID}},                             // 返回一级界面
             {CANCEL_THINKING_BUTTON_VIEW_ID, {AIVOICE_THINKING_VIEWID, AIVOICE_STARTCHAT_VIEWID}},                                                 // 返回一级界面
             {AIVOICECONNECTINGVIEW_CANCEL_BUTTON_VIEW_ID, {AIVOICE_AIMODE_CONNECTING, AIVOICE_STARTCHAT_VIEWID}},                                  // 返回一级界面
-            {AIVOICERETURNRESULTTEXT_RETURN_BUTTON_VIEW_ID, {AIVOICE_RETURN_RESULT_TEXT_VIEWID, AIVOICE_STARTCHAT_VIEWID}},                        // 返回一级界面,并清除手表聊天记录
-            {AIVOICERETURNRESULTTEXT_CONTINUECHAT_BUTTON_VIEW_ID, {AIVOICE_RETURN_RESULT_TEXT_VIEWID, AIVOICE_LISTENING_VIEWID}},                  // 返回继续聆听,并清除手表聊天记录
+            // {AIVOICERETURNRESULTTEXT_RETURN_BUTTON_VIEW_ID, {AIVOICE_RETURN_RESULT_TEXT_VIEWID, AIVOICE_STARTCHAT_VIEWID}},                        // 返回一级界面,并清除手表聊天记录
+            // {AIVOICERETURNRESULTTEXT_CONTINUECHAT_BUTTON_VIEW_ID, {AIVOICE_RETURN_RESULT_TEXT_VIEWID, AIVOICE_LISTENING_VIEWID}},                  // 返回继续聆听,并清除手表聊天记录
         };
         auto it = viewIdMap.find(viewId);
         if (it != viewIdMap.end())
         {
-            if (it->first == AIVOICERETURNRESULTTEXT_CONTINUECHAT_BUTTON_VIEW_ID) // 点击继续对话按钮要发取消当前对话指令,避免AI回应中途按继续对话按钮没有取消上一次对话问题
-            {
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CancelCurAIChat");
-                AiVoiceModel::GetInstance().CancelCurAIChat();
-                PlayersModel::GetInstance()->HandPausePhoneMusic(); // 暂停手机音乐
-                PlayersModel::GetInstance()->PlayerPause();         // 暂停手机音乐
-            }
+            // if (it->first == AIVOICERETURNRESULTTEXT_CONTINUECHAT_BUTTON_VIEW_ID) // 点击继续对话按钮要发取消当前对话指令,避免AI回应中途按继续对话按钮没有取消上一次对话问题
+            // {
+            //     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CancelCurAIChat");
+            //     AiVoiceModel::GetInstance().CancelCurAIChat();
+            //     PlayersModel::GetInstance()->HandPausePhoneMusic(); // 暂停手机音乐
+            //     PlayersModel::GetInstance()->PlayerPause();         // 暂停手机音乐
+            // }
             ChangeViewAndLogicOperator(it->second.first, it->second.second);
             return true;
         }
index 04b422d..545c7ae 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-07-18 14:55:27
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-21 10:23:23
+ * @LastEditTime: 2024-10-24 20:17:13
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp
  */
 
@@ -52,6 +52,7 @@ namespace OHOS
     {
         if (ConfigModel::GetInstance()->GetisFirstTimeStart() == true)
         {
+            
             uapi_set_screen_on_api();
             ConfigModel::GetInstance()->SetisFirstTimeStart(false);
             NativeAbility::GetInstance().SetDefaultSliceId(VIEW_MAIN);
@@ -559,7 +560,7 @@ namespace OHOS
     /*注册所有按键事件*/
     void RebootAndShutdownModel::RegisterAllKeyEvents(void)
     {
-        RegisterPowerKeyDoubleClickEvent();
+        // RegisterPowerKeyDoubleClickEvent();
         RegisterPowerKeyLongPressEvent();
         RegisterFuncKeyPressEvent();
         RegisterFuncKeyLongPressEvent();
index 362a826..3b057c6 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-06-20 15:11:17
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-09-29 18:14:14
+ * @LastEditTime: 2024-10-24 20:17:39
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/RebootAndShutdownPresenter.cpp
  */
 #include "AppViewIDs.h"
@@ -135,7 +135,7 @@ namespace OHOS
         {
             if (strcmp(view.GetViewId(), REBOOT_AND_SHUTDOWN_GROUPVIEW) == 0)
             {
-                NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS);
+                NativeAbility::GetInstance().Back();
             }
             else if (strcmp(view.GetViewId(), FACTORY_RESET_GROUPVIEW) == 0)
             {
@@ -219,7 +219,7 @@ namespace OHOS
         {
             if (!isShutDownImageAnimatorStart)
             {
-                NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS);
+                NativeAbility::GetInstance().Back();
             }
         }
         return true;
index b038170..ac06afb 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-04-08 18:40:09
- * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-09-28 17:27:46
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-10-24 15:32:28
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp
  */
 #include "weather/include/WeatherModel.h"
@@ -172,14 +172,16 @@ namespace OHOS
     {
         // int index = Weather_data_t_now.iconNight;//夜晚天气图标
         int index;
-        if (IsNightTime())
-        {
-            index = Weather_data_t_now.iconNight; // 夜晚天气图标
-        }
-        else
-        {
-            index = Weather_data_seven_data[0].iconDay; // 白天天气图标
-        }
+        // if (IsNightTime())
+        // {
+        //     index = Weather_data_t_now.iconNight; // 夜晚天气图标
+        // }
+        // else
+        // {
+        //     index = Weather_data_seven_data[0].iconDay; // 白天天气图标
+        // }
+        index = Weather_data_seven_data[0].iconDay; // 白天天气图标
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Weather_data_t_now.iconNight = %d", index);        
         return weather65x65[index];
     }
 
@@ -194,14 +196,16 @@ namespace OHOS
     std::string WeatherModel::GetWeatherDescription()
     {
         std::string WeatherDescription;
-        if (IsNightTime())
-        {
-            WeatherDescription = Weather_data_t_now.textNight;
-        }
-        else
-        {
-            WeatherDescription = Weather_data_seven_data[0].textDay;
-        }
+        // if (IsNightTime())
+        // {
+        //     WeatherDescription = Weather_data_t_now.textNight;
+        // }
+        // else
+        // {
+        //     WeatherDescription = Weather_data_seven_data[0].textDay;
+        // }
+        WeatherDescription = Weather_data_seven_data[0].textDay;
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherDescription:%s", WeatherDescription.c_str());
         return WeatherDescription;
     }
 
@@ -346,14 +350,15 @@ namespace OHOS
         if (DialModelWeather::GetInstance())
         {
             int index;
-            if(IsNightTime())
-            {
-                index = Weather_data_t_now.iconNight; // 夜晚天气图标
-            }
-            else
-            {
-                index = Weather_data_seven_data[0].iconDay; //白天天气图标
-            }
+            // if(IsNightTime())
+            // {
+            //     index = Weather_data_t_now.iconNight; // 夜晚天气图标
+            // }
+            // else
+            // {
+            //     index = Weather_data_seven_data[0].iconDay; //白天天气图标
+            // }
+            index = Weather_data_seven_data[0].iconDay; //白天天气图标
             DialModelWeather::GetInstance()->UpdateWeather(index); // 更新主界面天气图标
             // const std::string str = GetWeatherTemperature() + " "+GetWeatherDescription();
             const std::string str = GetWeatherTemperature();