From 0ac2782ab21316c3c4ca09ce73dcf4be7f954c2e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=83=A1=E4=BC=A0=E5=86=9B?= <1224667075@qq.com> Date: Sat, 19 Oct 2024 10:56:44 +0000 Subject: [PATCH] Merge #1216 into sdk602patch0911 from refs/changes/1216/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 先关闭4G电话对麦克风管理,可能导致音频系统锁死 * refs/changes/1216/head: (1 commits squashed) - 先关闭4G电话对麦克风管理,可能导致音频系统锁死 Signed-off-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1216 --- .../nativeui/callerlog/src/CallerLogModel.cpp | 24 +++++++++------ .../makephone/src/MainCallingPresenter.cpp | 30 +++++++++++++------ .../phoneservice/include/PhoneAudio.h | 5 ++++ .../phoneservice/include/PhoneService.h | 3 ++ .../nativeui/phoneservice/src/PhoneAudio.cpp | 19 +++++++----- .../phoneservice/src/PhoneService.cpp | 5 ++++ .../phoneservice/src/PhoneService.cpp | 1 + .../msg_center/src/msg_center_customer.cpp | 23 +++++++++----- .../src/notify/makephone_notification.cpp | 3 ++ .../slip/cat1Service/cat1_server.cpp | 3 +- 10 files changed, 82 insertions(+), 34 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp index 157193331..565490f98 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp @@ -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()) diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp index 95fa5fd62..ecb1d420c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingPresenter.cpp @@ -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"); diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneAudio.h b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneAudio.h index 6063ee4d2..218acc023 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneAudio.h +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneAudio.h @@ -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 diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h index 5eda78da3..6d58cc71b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h @@ -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 diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneAudio.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneAudio.cpp index fcc491ae7..68e9b1e03 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneAudio.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneAudio.cpp @@ -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) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp index 56bf0bfef..aa2dec3d7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -2033,6 +2033,11 @@ bool SetMicMute(bool isMute) return PhoneAudioSetMicMute(isMute); } +int32_t SetMicMutecat1(bool isMute) +{ + return PhoneAudioSetMicMuteCat1(isMute); +} + // 获取SCO的连接状态 int GetScoConnectState(void) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp index 701c9ca47..e1cd9926b 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp @@ -1808,6 +1808,7 @@ bool SetMicMute(bool isMute) return PhoneAudioSetMicMute(isMute); } + // 获取SCO的连接状态 int GetScoConnectState(void) { diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 11c08bf7b..e3c4100fc 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -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; diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp index 1845a77c2..2ea9ca6bc 100755 --- a/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp @@ -511,6 +511,9 @@ static void AlertingHandle(void) static void IncomingHandle(void) { CallerLogModel::GetInstance()->SetMakePhoneStatus(false); + + InitCallingTimer(); + DisableCallTimer(CallTimerType::NOTIFY_PHONE_DIAL_DISPLAY); } diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp index 9ba6cc1d1..1c0f7baf9 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp @@ -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); } -- 2.17.1