先关闭4G电话对麦克风管理,可能导致音频系统锁死 1216/1 1216/head
authorhcj <1224667075@qq.com>
Sat, 19 Oct 2024 08:19:32 +0000 (16:19 +0800)
committerhcj <1224667075@qq.com>
Sat, 19 Oct 2024 08:19:32 +0000 (16:19 +0800)
code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp
code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneAudio.h
code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h
code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneAudio.cpp
code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp
code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp
code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp

index 1571933..565490f 100644 (file)
@@ -132,7 +132,7 @@ void StatusReset(void)
     CallerLogModel::GetInstance()->SetCallStatus(false);
     CallerLogModel::GetInstance()->SetWaitingStatus(false);
     DisableCallingTimer();
-    
+
     if(CallerLogModel::GetInstance()->GetCallSource()==CallerLogModel::CallSourceCat1)
     uapi_cat1_stop_volte_voice();
 
@@ -183,21 +183,27 @@ static void CallTimerCallbackProc(int data)
         }
    }
 
+
     if( CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1
     && NotificationManager::GetInstance()->GetWatchCallStatus()==true)
    {    
-        if(!volte_voice_state())
-        uapi_cat1_start_volte_voice();
-
-        if(get_call_hungup_flag()>=2)
+        if(!MainCallingView::GetInstance()->GetDisplayGroup()->IsVisible())
         {
-            cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
+             if(!volte_voice_state())
+            uapi_cat1_start_volte_voice();
         }
-        else if(get_call_hungup_flag())
+       
         {
-            set_call_hungup_flag(get_call_hungup_flag()+1);
-
+            if(get_call_hungup_flag()>=2)
+            {
+                cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
+            }
+            else if(get_call_hungup_flag())
+            {
+                set_call_hungup_flag(get_call_hungup_flag()+1);
+            }
         }
+       
    }
 
 //     if(MainCallingView::GetInstance()->GetScreenView())
index 95fa5fd..ecb1d42 100644 (file)
@@ -203,7 +203,15 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
             {
                 view_->GetScreenView()->GetImageMicrophone()->SetSrc(PNG_230_MICROPHONE_CLOSE_IMAGE_PATH);
             }
-            SetMicMute(true);
+            if(CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
+            {
+                //SetMicMutecat1(true);
+            }
+            else
+            {
+                 SetMicMute(true);
+            }
+           
             
         } else {
             changeImage = 0;
@@ -216,7 +224,14 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
             {
                 view_->GetScreenView()->GetImageMicrophone()->SetSrc(PNG_230_MICROPHONE_OPEN_IMAGE_PATH);
             }
-            SetMicMute(false);
+            if(CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
+            {
+                //SetMicMutecat1(false);
+            }
+            else
+            {
+                 SetMicMute(false);
+            }
         }
         return true;
     } else if (strcmp(view.GetViewId(), "displayHandUp") == 0 || strcmp(view.GetViewId(), "callingHandUp") == 0||
@@ -299,13 +314,9 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::phone calling");
         if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
         {
-            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MakephoneNotify 11111111 ");
-            //#ifdef SUPPORT_CAT1_SERVICE
-                
-                WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AcceptIncomingCall] start");
-                //incomedcall_event_sendmsg_toUI("ok");
-                cat1_call_answer();
-                return true;
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MakephoneNotify 11111111 ");
+            cat1_call_answer();
+            return true;
 
             //#endif
         }
@@ -313,6 +324,7 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
         {
               // 界面的显示和隐藏
             SetMicMute(false);
+
             // 手表接听呼入来电
             if (AcceptIncomingCall() != 0) {
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::AcceptIncomingCall() fail");
index 6063ee4..218acc0 100644 (file)
@@ -26,6 +26,8 @@ bool PhoneAudioSetSpeakerMute(bool isMute);
 // 设置通话mic静音/取消静音
 bool PhoneAudioSetMicMute(bool isMute);
 
+
+
 int32 PhoneAudioManagerInit(void);
 
 int32 PhoneAudioManagerActInterrupt(AudioStreamType streamType);
@@ -70,6 +72,9 @@ int32 PhoneCAT1AudioGetVolume(void);
 
 bool PhoneCATAudioSetVolume(int32 volume);
 
+
+int32_t PhoneAudioSetMicMuteCat1(bool isMute);
+
 #ifdef __cplusplus
 }
 #endif
index 5eda78d..6d58cc7 100644 (file)
@@ -283,6 +283,9 @@ void set_speaker_volume(unsigned char hfpVolume,int type);
 
 int SaveCallLog(CallLogInfo **info,int num);
 
+
+int32_t SetMicMutecat1(bool isMute);
+
 #ifdef __cplusplus
 }
 #endif
index fcc491a..68e9b1e 100644 (file)
@@ -136,17 +136,22 @@ bool PhoneAudioSetMicMute(bool isMute)
     }
     ret = g_amInstance.SetMicrophoneMute(isMute);
     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[PhoneAudioSetMicMute] end! ret = %d", ret);
+    return ret;
+}
 
-    if(OHOS::CallerLogModel::GetInstance()->GetCallSource() == OHOS::CallerLogModel::CallSourceCat1)
-    {
-        AudioStreamOutSetMute(isMute);
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioStreamOutSetMute] end! ret = %d", ret);
-    }
-    
+//cat1取消静音
+int32_t PhoneAudioSetMicMuteCat1(bool isMute)
+{
+    int32_t ret;
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioStreamOutSetMute] end! ret = %d", ret);
+    ret=AudioStreamOutSetMute(isMute);
+    return 0;
 
-    return ret;
+ 
 }
 
+    
+
 static bool CheckParam(int32 instanceNum)
 {
     if (instanceNum == 0 || instanceNum == 1) {
index 56bf0bf..aa2dec3 100644 (file)
@@ -2033,6 +2033,11 @@ bool SetMicMute(bool isMute)
     return PhoneAudioSetMicMute(isMute);
 }
 
+int32_t SetMicMutecat1(bool isMute)
+{
+    return PhoneAudioSetMicMuteCat1(isMute);
+}
+
 // 获取SCO的连接状态
 int GetScoConnectState(void)
 {
index 11c08bf..e3c4100 100644 (file)
@@ -73,7 +73,7 @@
 #include "main/include/PullUpDownView.h"
 #include "player/include/PlayersModelC.h"
 #include "system/include/SystemLogModelC.h"
-
+#include "cat1_ctl.h"
 #include "ui_service.h"
 #define DIALDATASET 1
 //#include "Systemupgrade.h"
@@ -918,8 +918,6 @@ void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req)
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "????????????????????");
         }
     
-
-        // int ret = PlayersModel::GetInstance()->PlayerStop();
         stopPlayingMusic();
 
         const power_display_svr_api_t *display_api = power_display_svr_get_api();
@@ -927,6 +925,7 @@ void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req)
         {   
             display_api->turn_on_screen();  
         } 
+
         if(true != ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()) && true != ConfigModel::GetInstance()->GetSilentMode())
         {
             AlarmClockModel::GetInstance()->testPlayerStart("/music/ring/ring.mp3");
@@ -953,12 +952,17 @@ void MsgCenterNotifyCat1CallConnectedProc(const Topic topic, Request* req)
     {
         return;
     }
-    SetMicMute(false);
     AlarmClockModel::GetInstance()->AlarmPlayerStop();
-    //AlarmViewEventListener::GetInstance()->CancelAlarmRing();
-    // NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE);
-    cat1_phone_state_change_cb(OPERATE_WATCH_ACTIVE);
+     //AlarmViewEventListener::GetInstance()->CancelAlarmRing();
+    uapi_cat1_start_volte_voice();
+
     CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1);
+
+    //暂时关闭该功能,易导致系统音频锁死
+    // SetMicMutecat1(false);
+
+    cat1_phone_state_change_cb(OPERATE_WATCH_ACTIVE);
+  
     NotificationManager::GetInstance()->SetWatchCallStatus(true);
     
 
@@ -978,6 +982,7 @@ void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req)
 
     // int ret = PlayersModel::GetInstance()->PlayerStop();
     stopPlayingMusic();
+    
     //uapi_hfp_disconnect();
     if(strcmp(call_data,"SOS")==0)
     {
@@ -987,6 +992,9 @@ void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req)
     }
     
     cat1_call_dial(call_data);
+
+    uapi_cat1_start_volte_voice();
+
     CallerLogModel::GetInstance()->SetoperateNumber(call_data,req->len);
     CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1);
 
@@ -1004,6 +1012,7 @@ void MsgCenterNotifyCat1CallEndedProc(const Topic topic, Request* req)
     // just stop the notify
     AlarmClockModel::GetInstance()->AlarmPlayerStop();
 
+
     if(!NotificationManager::GetInstance()->GetWatchCallStatus())
     {
         return;
index 1845a77..2ea9ca6 100755 (executable)
@@ -511,6 +511,9 @@ static void AlertingHandle(void)
 static void IncomingHandle(void)
 {
     CallerLogModel::GetInstance()->SetMakePhoneStatus(false);
+
+    InitCallingTimer();
+    
     DisableCallTimer(CallTimerType::NOTIFY_PHONE_DIAL_DISPLAY);
 
 }
index 9ba6cc1..1c0f7ba 100644 (file)
@@ -380,8 +380,7 @@ void udp_send_msg_toCat1(uint8_t cmd,char *content)
         
         udp_send_response(station_tx_buffer, cmd, content);
 
-        if(cmd==UDP_CMD_DIAL_NUMB || cmd== UDP_CMD_ANSWER )
-        uapi_cat1_start_volte_voice();
+     
     }
      uapi_cat1_wakeup_cat1(0);
 }