Merge #1235 into sdk602patch0911 from refs/changes/1235/head 1237/target/1
author胡传军 <1224667075@qq.com>
Mon, 21 Oct 2024 11:51:36 +0000 (11:51 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Mon, 21 Oct 2024 11:51:36 +0000 (11:51 +0000)
Code review from 胡传军

* refs/changes/1235/head: (14 commits squashed)

  - 先关闭4G电话对麦克风管理,可能导致音频系统锁死

  - 修复电话界面动画问题

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

  - 增加最大数量表盘限制,待测试 ,修改BLE打印日志

  - 修改获取全部表盘id接口防止越界

  - 电话修改

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

  - 优化电话中再呼叫SOS

  - 合并

  - 增加蓝牙更改广播参数接口

  - 产测蓝牙广播频率修改

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

  - 增加4G对麦克风管理,多次测试未复现,需再验证

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

Signed-off-by: aliyun8003852482 <1224667075@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/1235
code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneAudio.cpp
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/middleware/services/media/foundation/sample/wrapper/audio_manager_c_wrapper.cpp
code/sdk/middleware/services/media/foundation/sample/wrapper/voice_call_volte_sample_wrapper.cpp

index ecb1d42..267997c 100644 (file)
@@ -205,7 +205,7 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
             }
             if(CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
             {
-                //SetMicMutecat1(true);
+                SetMicMutecat1(true);
             }
             else
             {
@@ -226,7 +226,7 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
             }
             if(CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
             {
-                //SetMicMutecat1(false);
+                SetMicMutecat1(false);
             }
             else
             {
index 68e9b1e..3d4114f 100644 (file)
@@ -16,6 +16,7 @@
 #include "wearable_log.h"
 #include "audio_manager_c_wrapper.h"
 #include "CallerLogModel.h"
+#include "cat1_ctl.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -143,8 +144,12 @@ bool PhoneAudioSetMicMute(bool isMute)
 int32_t PhoneAudioSetMicMuteCat1(bool isMute)
 {
     int32_t ret;
-    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioStreamOutSetMute] end! ret = %d", ret);
+    if(!volte_voice_state())
+    {
+        return 0;
+    }
     ret=AudioStreamOutSetMute(isMute);
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioStreamOutSetMute] end! ret = %d", ret);
     return 0;
 
  
index 25170f5..3a58e67 100644 (file)
@@ -965,7 +965,7 @@ void MsgCenterNotifyCat1CallConnectedProc(const Topic topic, Request* req)
     CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1);
 
     //暂时关闭该功能,易导致系统音频锁死
-    // SetMicMutecat1(false);
+    SetMicMutecat1(false);
 
     cat1_phone_state_change_cb(OPERATE_WATCH_ACTIVE);
   
@@ -973,6 +973,8 @@ void MsgCenterNotifyCat1CallConnectedProc(const Topic topic, Request* req)
     
 
 }
+#include "BluetoothModelC.h"
+#include "audio_manager_c_wrapper.h"
 //拨号处理函数
 void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req)
 {
@@ -989,6 +991,10 @@ void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req)
     // int ret = PlayersModel::GetInstance()->PlayerStop();
     stopPlayingMusic();
     
+    // PlayersModel::GetInstance()->HandPausePhoneMusci(); // 暂停手机音乐
+    // AudioManagerDeactivateInterrupt();
+    //BtA2dpSnkAudioDestroy();
+
     //uapi_hfp_disconnect();
     if(strcmp(call_data,"SOS")==0)
     {
index 1740728..39d6ba7 100755 (executable)
@@ -251,14 +251,17 @@ int32_t AudioStreamOutInit(AudioRendererConfig renderConfig)
 
 int32_t AudioStreamOutSetMute(bool mute)
 {
-    int32_t ret = g_streamOut->SetMute(mute);
-    if (ret != AUDIO_SUCCESS) {
-        ALOGE("audio stream out set mute failed 0x%x", ret);
-        return AUDIO_ERROR;
+    if(g_streamOut)
+    {
+        int32_t ret = g_streamOut->SetMute(mute);
+        if (ret != AUDIO_SUCCESS) {
+            ALOGE("audio stream out set mute failed 0x%x", ret);
+            return AUDIO_ERROR;
+        }
+        ALOGD("success");
+        return AUDIO_SUCCESS;
     }
-
-    ALOGD("success");
-    return AUDIO_SUCCESS;
+    return AUDIO_ERROR;
 }
 
 int32_t AudioManagerSetSeaEnable(bool enable)
@@ -805,7 +808,7 @@ static void *A2dpSinkThread(void *priv)
         }
         while (true) {
             if (a2dpContext->isA2dpSinkStopped) {
-                AudioManagerA2dpSinkAllStop(a2dpContext);\r
+                AudioManagerA2dpSinkAllStop(a2dpContext);
                 a2dpContext->a2dpSinkCount--;
                 break;
             }
index 33ace63..9c614e7 100755 (executable)
@@ -520,7 +520,7 @@ static void *VoiceCallVolteThread(void *priv)
         MEDIA_ERR_LOG("release audio focus failed");
         return nullptr;
     }
-
+    printf("VoiceCallVolteThread END");
     return nullptr;
 }