Merge #1239 into sdk602patch0911 from refs/changes/1239/head 1240/target/1 1241/target/1 1242/target/1
author罗正 <1732036298@qq.com>
Tue, 22 Oct 2024 08:20:20 +0000 (08:20 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Tue, 22 Oct 2024 08:20:20 +0000 (08:20 +0000)
Code review from 罗正

* refs/changes/1239/head: (12 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

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/1239
code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp

index 9aeb21b..2e6639b 100644 (file)
@@ -747,11 +747,13 @@ void ButtonOnClickListener::SoundButtonOnClick()
         return;\r
     }\r
     /* -------------------------------------------------------------------------- */\r
-    if (PlayersModel::GetInstance()->get_avrcp_ct_or_tg_is_connected() && \r
-                PlayersModel::GetInstance()->get_a2dp_sink_playing_state()) //若ct或tg端是已连接状态且当前a2dp_sink是已播放状态\r
-    {\r
-        playersView->ChangeView(PlayersView::MAIN_MUSICPLAYER_VIEW, PlayersView::MUSIC_PLAYER_TIP_VIEW); // 跳转到提示界面\r
-        return;\r
+    if(PlayersModel::GetInstance()->GetMusicSource() == false) { //如果当前是本地音乐\r
+        if (PlayersModel::GetInstance()->get_avrcp_ct_or_tg_is_connected() && \r
+                    PlayersModel::GetInstance()->get_a2dp_sink_playing_state()) //若ct或tg端是已连接状态且当前a2dp_sink是已播放状态\r
+        {\r
+            playersView->ChangeView(PlayersView::MAIN_MUSICPLAYER_VIEW, PlayersView::MUSIC_PLAYER_TIP_VIEW); // 跳转到提示界面\r
+            return;\r
+        }\r
     }\r
     /* -------------------------------------------------------------------------- */\r
     playersView->ChangeView(PlayersView::MAIN_MUSICPLAYER_VIEW, PlayersView::MUSIC_VOLUME_CONTROL_VIEW);\r
index 8fc5094..b977038 100644 (file)
@@ -385,7 +385,11 @@ namespace OHOS
                     RecordingPlayerView::GetInstance()->SetPlayerButtonState(UICheckBox::UNSELECTED);
                 }
             }
-            AudioManager::GetInstance().DeactivateAudioInterrupt(interrupt);
+            if (AudioManager::GetInstance().DeactivateAudioInterrupt(interrupt) != 0)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DeactivateAudioInterrupt err");
+                return OHOS_FAILURE;
+            }
             return OHOS_SUCCESS;
         }
         else if (state == PlayerStates::PLAYER_STOPPED)
@@ -410,6 +414,12 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Reset err, ret:%d", ret);
             return OHOS_FAILURE;
         }
+        if (AudioManager::GetInstance().DeactivateAudioInterrupt(interrupt) != 0)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DeactivateAudioInterrupt err");
+            return OHOS_FAILURE;
+        }
+        IsActivateAudioInterrupt = false;
         return OHOS_SUCCESS;
     }
 
index 646c105..e0e16f1 100644 (file)
@@ -1259,7 +1259,7 @@ void MsgCenterNotifyCanCelFindWatchProc(const Topic topic, Request* req)
     unused(topic);
     unused(req);
     WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyCanCelFindWatchProc !");
-    FindWatchViewEventListener::GetInstance().PopInterCancelMusic();
+    // FindWatchViewEventListener::GetInstance().PopInterCancelMusic();
     if (FindWatchViewEventListener::GetInstance().GetFindWatchNotifyFlag() == true) {
         NotificationManager::GetInstance()->StopNotify();
     }
index 0f6e128..a6481f7 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-03-25 17:33:47
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-18 18:02:00
+ * @LastEditTime: 2024-10-22 10:23:38
  * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp
  * @details:实现查找手表的功能一般需要手表和智能手机之间的配合,通常是通过手机上的应用(App)或其他设备发送指令给手表,触发手表的查找功能。
  * 以下是基本的实现步骤:
@@ -69,7 +69,7 @@ namespace OHOS
 #ifdef SUPPORT_BLE_SERVICE
             setFindWatchFlag(2); // 表示已找到手表
 #endif
-            FindWatchRingPlayStop();
+            // FindWatchRingPlayStop();
             NotificationManager::GetInstance()->StopNotify();
             SetFindWatchNotifyFlag(false);
             // ResumeScreenBrightness();
@@ -96,7 +96,7 @@ namespace OHOS
 #ifdef SUPPORT_BLE_SERVICE
             setFindWatchFlag(2); // 表示已找到手表
 #endif
-            FindWatchRingPlayStop();
+            // FindWatchRingPlayStop();
             NotificationManager::GetInstance()->StopNotify();
             SetFindWatchNotifyFlag(false);
             // ResumeScreenBrightness();
@@ -292,6 +292,7 @@ namespace OHOS
      */
     int FindWatchViewEventListener::FindWatchRingPlayStart(const char *path)
     {
+        FindWatchRingPlayStop(); // 如果playerCtr上音频资源没被释放,先释放
         FindWatchRingPlayerInit(((path == nullptr) ? RingMusicName : path));
         FindWatchRingPlayerStat();
         return OHOS_SUCCESS;
@@ -476,6 +477,7 @@ namespace OHOS
             FindWatchGroupView = nullptr;
         }
 
+        FindWatchViewEventListener::GetInstance().FindWatchRingPlayStop();
         FindWatchViewEventListener::GetInstance().ResumeScreenBrightness();
         FindWatchViewEventListener::GetInstance().FindWatch_StopTimer();
     }