version https://git-lfs.github.com/spec/v1
-oid sha256:6d0298cc726fb3ff2290406bf86f52bf9e53c048bdafc71a1b43a0064bbfb708
+oid sha256:7a128a9f6ed1e1638677d14dff57f0c63e51d590796549dd382efd073ba9f1ff
size 424904
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);
// 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);
}
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
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");
- // }
}
}
}
+#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)
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;
#include "msg_center_customerC.h"
#include "PhoneAGService.h"
#include <custom_save_runtime.h>
+#include "PhoneServiceC.h"
#define DIALDATASET 1
//#include "Systemupgrade.h"
// 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);
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
}
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
{
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);
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
}
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)
{
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)
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;
}
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)
void uapi_cat1_suspend(void);\r
void uapi_cat1_resume(void);\r
\r
+void recover_call_state(void);\r
+\r
#ifdef __cplusplus\r
#if __cplusplus\r
}\r
{
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);
{ "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}
};