From: hcj <1224667075@qq.com> Date: Fri, 17 Jan 2025 09:39:25 +0000 (+0800) Subject: cat AG服务修改。(含BT.bin修改,需更新BT.bin) X-Git-Tag: v1.3.113-repair_tp~27 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=d8c1598e10731ab7d92cac32b9cc50a015ca8f17;p=mirrors%2FFD230.git cat AG服务修改。(含BT.bin修改,需更新BT.bin) --- diff --git a/bin/bt.bin b/bin/bt.bin index 749411053..e000b8f04 100644 --- a/bin/bt.bin +++ b/bin/bt.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d0298cc726fb3ff2290406bf86f52bf9e53c048bdafc71a1b43a0064bbfb708 +oid sha256:7a128a9f6ed1e1638677d14dff57f0c63e51d590796549dd382efd073ba9f1ff size 424904 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 8bdf0c4ce..6ecaa78c5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp @@ -145,29 +145,13 @@ void StatusReset(void) CallerLogModel::GetInstance()->SetWaitingStatus(false); DisableCallingTimer(); - if(CallerLogModel::GetInstance()->GetCallSource()==CallerLogModel::CallSourceCat1) - { - #ifdef SUPPORT_CAT1_HFP_AG_SERV - if(headset_SCO_Is_connect()) - { - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_DIS_SCO_CONNECT, nullptr, 0); - } - else - #endif - - { - #ifdef SUPPORT_CAT1_HFP_AG_SERV - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_AUDIO_END, nullptr, 0); - #endif - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0); - } - } + CallerLogModel::GetInstance()->Setphonebname("",0); CallerLogModel::GetInstance()->SetCallDial(CallerLogModel::HFP_PHONE_DIAL); CallerLogModel::GetInstance()->set_RejectIncomingCall_falg(0); NotificationManager::GetInstance()->SetWatchCallStatus(false); - CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourcePhone); + DisshakeTimer(); set_call_hungup_flag(0); set_TransCallToMobilePhone_falg(0); @@ -176,6 +160,27 @@ void StatusReset(void) // If the call is handling in the notification, the slice is not switched //if (!CallerLogModel::GetInstance()->GetNotifyFlag()) + if(CallerLogModel::GetInstance()->GetCallSource()==CallerLogModel::CallSourceCat1) + { + if(headset_SCO_Is_connect()==false) + { + #ifdef SUPPORT_CAT1_HFP_AG_SERV + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_AUDIO_END, nullptr, 0); + #endif + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0); + } + else + { + #ifdef SUPPORT_CAT1_HFP_AG_SERV + if(headset_Is_connect()) + { + cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLENDED,NULL); + } + #endif + } + CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourcePhone); + } + { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "xxxxxxxxxxxxx"); PhoneServiceScreenCtr(false); @@ -235,6 +240,14 @@ static void CallTimerCallbackProc(int data) } do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0); } + if(headset_SCO_Is_connect()==true && volte_voice_state()!=2) + { + if(volte_voice_state()==2) + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0); + } + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); + } } #endif diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneAGService.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneAGService.cpp index 783c95c4e..611788142 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneAGService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneAGService.cpp @@ -241,16 +241,6 @@ static void sample_hfp_ag_conn_state_changed_callback(const bd_addr_t *bd_addr, if(state==PROFILE_STATE_DISCONNECTED) { - // if(OHOS::CallerLogModel::GetInstance()->GetCallSource() == OHOS::CallerLogModel::CallSourceCat1 - // && OHOS::NotificationManager::GetInstance()->GetWatchCallStatus()) - // { - // if(volte_voice_state()==0) - - // } - // else - // { - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"电话结束\n"); - // } } } @@ -262,6 +252,60 @@ void cat1_start_SCO_audio_(void) } +#ifdef __cplusplus +extern "C" { +#endif + +static void PostGraphicEvent(void (*fun)(void)) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PostGraphicEvent] start"); + GraphicService::GetInstance()->PostGraphicEvent(*fun); +} + +#ifdef __cplusplus +} +#endif + + + +void HFP_SCO_STATE_CONNECTEDPro(void) +{ + if(volte_voice_state()==0) + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); + } + else + { + if(OHOS::CallerLogModel::GetInstance()->GetCallSource() == OHOS::CallerLogModel::CallSourceCat1 + && OHOS::NotificationManager::GetInstance()->GetWatchCallStatus()) + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0); + + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); + } + + } + +} + +void HFP_SCO_STATE_DISCONNECTEDPro(void) +{ + if(OHOS::CallerLogModel::GetInstance()->GetCallSource() == OHOS::CallerLogModel::CallSourceCat1 + && OHOS::NotificationManager::GetInstance()->GetWatchCallStatus()) + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0); + + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0); + } + else + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_AUDIO_END, nullptr, 0); + + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0); + } + +} + static void sample_hfp_ag_sco_conn_state_changed_callback(const bd_addr_t *bd_addr, hfp_sco_connect_state_t state) @@ -274,39 +318,16 @@ static void sample_hfp_ag_sco_conn_state_changed_callback(const bd_addr_t *bd_ad break; case HFP_SCO_STATE_CONNECTED: - if(volte_voice_state()==0) - { - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); - } - else - { - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0); - - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); - } + + PostGraphicEvent(HFP_SCO_STATE_CONNECTEDPro); Call_headset_state_updata(1); - - break; case HFP_SCO_STATE_DISCONNECTING: break; case HFP_SCO_STATE_DISCONNECTED: - if(OHOS::CallerLogModel::GetInstance()->GetCallSource() == OHOS::CallerLogModel::CallSourceCat1 - && OHOS::NotificationManager::GetInstance()->GetWatchCallStatus()) - { - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0); - - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_START, nullptr, 0); - } - else - { - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_AUDIO_END, nullptr, 0); - - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0); - } - + PostGraphicEvent(HFP_SCO_STATE_DISCONNECTEDPro); Call_headset_state_updata(0); break; 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 28a0f8e14..2215bf573 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 @@ -93,6 +93,7 @@ #include "msg_center_customerC.h" #include "PhoneAGService.h" #include +#include "PhoneServiceC.h" #define DIALDATASET 1 //#include "Systemupgrade.h" @@ -1081,7 +1082,8 @@ void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req) // Prevent this from happening: // When the incoming call view is displayed, the calling number is not set in CallerLogModel. //uapi_hfp_disconnect(); -//来电 +//来电 + recover_call_state(); #ifdef SUPPORT_CAT1_HFP_AG_SERV if(headset_Is_connect()) cat1_ag_send_call_event(TOPIC_EVENT_CAT1_INCOMMING,call_data); @@ -1151,7 +1153,17 @@ void MsgCenterNotifyCat1CallConnectedProc(const Topic topic, Request* req) if(headset_Is_connect()) { cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLCONNTED,NULL); - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_CONNECT, nullptr, 0); + + if(headset_SCO_Is_connect()==false) + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_CONNECT, nullptr, 0); + // cat1_connect_sco_(); + } + else + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); + } + } else @@ -1197,19 +1209,29 @@ void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req) } cat1_call_dial(call_data); + recover_call_state(); CallerLogModel::GetInstance()->SetoperateNumber(call_data,req->len); + + cat1_phone_state_change_cb(OPERATE_DIALING); + #ifdef SUPPORT_CAT1_HFP_AG_SERV if(headset_Is_connect()) { cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLDIAL,NULL); - do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_CONNECT, nullptr, 0); - - + + if(headset_SCO_Is_connect()==false) + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_CONNECT, nullptr, 0); + } + else + { + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0); + } } else #endif @@ -1248,14 +1270,7 @@ void MsgCenterNotifyCat1CallEndedProc(const Topic topic, Request* req) { cat1_call_hungup(); - cat1_phone_state_change_cb(OPERATE_WATCH_FINISH); - - #ifdef SUPPORT_CAT1_HFP_AG_SERV - if(headset_Is_connect()) - cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLENDED,NULL); - #endif - CustomEventPublish(TOPIC_EVENT_CAT1_CALL_FAIL,NULL,0); free(call_data); @@ -1289,11 +1304,7 @@ void MsgCenterNotifyCat1CallEndedProc(const Topic topic, Request* req) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OPERATE_WATCH_FINISH"); cat1_phone_state_change_cb(OPERATE_WATCH_FINISH); #ifdef SUPPORT_CAT1_HFP_AG_SERV - if(headset_Is_connect()) - { - cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLENDED,NULL); - } - + #endif } diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp index b44d0f1a2..826bd682c 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp @@ -75,6 +75,7 @@ uint8_t volte_voice_state(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"volte_voice_state %d \n",cat1_voice); return cat1_voice; } +static int8_t is_stop_call=0; int32_t uapi_cat1_start_volte_voice(void) { @@ -84,7 +85,7 @@ int32_t uapi_cat1_start_volte_voice(void) int32_t argc = 1; uint8_t *argv = (uint8_t *)"start"; - if(cat1_voice==0) + if(cat1_voice==0 && is_stop_call!=1) { ret = VoiceCallVolteSample(argc, (const char **)&argv); if(ret==0) @@ -97,15 +98,30 @@ int32_t uapi_cat1_start_volte_voice(void) return ret; } +void recover_call_state(void) +{ + is_stop_call=0; +} int32_t uapi_stop_call(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"uapi_cat1_RequsetAudioFocus\n"); - + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"uapi_stop_call\n"); int32_t ret = ERRCODE_FAIL; int32_t argc = 1; - uint8_t *argv = (uint8_t *)"stopcall"; - ret = VoiceCallVolteSample(argc, (const char **)&argv); + + if(cat1_voice!=0) + { + uint8_t *argv = (uint8_t *)"stopcall"; + ret = VoiceCallVolteSample(argc, (const char **)&argv); + } + else if(is_stop_call==0) + { + uint8_t *argv = (uint8_t *)"ReleaseAudioFocus"; + ret = VoiceCallVolteSample(argc, (const char **)&argv); + } + + is_stop_call=1; + return ret; } @@ -117,7 +133,7 @@ int32_t uapi_cat1_start_SCO_volte_voice(void) int32_t argc = 1; uint8_t *argv = (uint8_t *)"startSCO"; - if(cat1_voice==0) + if(cat1_voice==0 && is_stop_call!=1) { ret = VoiceCallVolteSample(argc, (const char **)&argv); if(ret==0) diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h index 9ea851c9f..57f8df586 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h @@ -42,6 +42,8 @@ bool uapi_cat1_get_power_stat(void); void uapi_cat1_suspend(void); void uapi_cat1_resume(void); +void recover_call_state(void); + #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/middleware/services/media/foundation/player/frameworks/player.cpp b/code/sdk/middleware/services/media/foundation/player/frameworks/player.cpp index ca3b71d82..0c01f7ab5 100755 --- a/code/sdk/middleware/services/media/foundation/player/frameworks/player.cpp +++ b/code/sdk/middleware/services/media/foundation/player/frameworks/player.cpp @@ -49,6 +49,7 @@ int32_t Player::SetSource(const Source &source) { int32_t ret; CHK_NULL_RETURN(impl_); + printf("Player::SetSource:%s\n",source.GetSourceUri().c_str()); ret = impl_->Init(); if (ret == 0) { ret = impl_->SetSource(source); diff --git a/code/sdk/middleware/services/media/foundation/sample/wrapper/voice_call_volte_sample_wrapper.cpp b/code/sdk/middleware/services/media/foundation/sample/wrapper/voice_call_volte_sample_wrapper.cpp index e6f178a88..452c06492 100755 --- a/code/sdk/middleware/services/media/foundation/sample/wrapper/voice_call_volte_sample_wrapper.cpp +++ b/code/sdk/middleware/services/media/foundation/sample/wrapper/voice_call_volte_sample_wrapper.cpp @@ -110,9 +110,9 @@ static FuncsMap g_voiceCallVolteFuncs[] = { { "seaenable", VoiceCAllSeaEnable }, { "mute", VoiceCallMicMute }, { "startSCO",StartHFPVoiceCall}, - { "stopcall",stopcall} + { "stopcall",stopcall}, // { "RequsetAudioFocus",NO_LOCAL_VOICE_CALL_RequsetAudioFocus}, - // { "ReleaseAudioFocus",ReleaseAudioFocus_HFP} + { "ReleaseAudioFocus",ReleaseAudioFocus_HFP} // { "updata_Audio_code_hfp",updata_Audio_code_hfp} };