summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bta/ag/bta_ag_cmd.c8
-rw-r--r--btif/src/btif_hf.c38
2 files changed, 28 insertions, 18 deletions
diff --git a/bta/ag/bta_ag_cmd.c b/bta/ag/bta_ag_cmd.c
index 7e69780..5d60405 100644
--- a/bta/ag/bta_ag_cmd.c
+++ b/bta/ag/bta_ag_cmd.c
@@ -1007,12 +1007,8 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
break;
case BTA_AG_HF_CMD_BVRA:
- /* if feature send OK, else don't call callback, send ERROR */
- if (p_scb->features & BTA_AG_FEAT_VREC)
- {
- bta_ag_send_ok(p_scb);
- }
- else
+ /* if feature not supported don't call callback, send ERROR. App will send OK */
+ if (!(p_scb->features & BTA_AG_FEAT_VREC))
{
event = 0;
bta_ag_send_error(p_scb, BTA_AG_ERR_OP_NOT_SUPPORTED);
diff --git a/btif/src/btif_hf.c b/btif/src/btif_hf.c
index 0df79f4..ddc4a14 100644
--- a/btif/src/btif_hf.c
+++ b/btif/src/btif_hf.c
@@ -571,15 +571,22 @@ static bt_status_t start_voice_recognition()
CHECK_BTHF_INIT();
if (is_connected(NULL))
{
- tBTA_AG_RES_DATA ag_res;
- memset(&ag_res, 0, sizeof(ag_res));
- ag_res.state = 1;
- BTA_AgResult (btif_hf_cb.handle, BTA_AG_BVRA_RES, &ag_res);
+ if (btif_hf_cb.peer_feat & BTA_AG_PEER_FEAT_VREC)
+ {
+ tBTA_AG_RES_DATA ag_res;
+ memset(&ag_res, 0, sizeof(ag_res));
+ ag_res.state = 1;
+ BTA_AgResult (btif_hf_cb.handle, BTA_AG_BVRA_RES, &ag_res);
- return BT_STATUS_SUCCESS;
+ return BT_STATUS_SUCCESS;
+ }
+ else
+ {
+ return BT_STATUS_UNSUPPORTED;
+ }
}
- return BT_STATUS_FAIL;
+ return BT_STATUS_NOT_READY;
}
/*******************************************************************************
@@ -597,15 +604,22 @@ static bt_status_t stop_voice_recognition()
if (is_connected(NULL))
{
- tBTA_AG_RES_DATA ag_res;
- memset(&ag_res, 0, sizeof(ag_res));
- ag_res.state = 0;
- BTA_AgResult (btif_hf_cb.handle, BTA_AG_BVRA_RES, &ag_res);
+ if (btif_hf_cb.peer_feat & BTA_AG_PEER_FEAT_VREC)
+ {
+ tBTA_AG_RES_DATA ag_res;
+ memset(&ag_res, 0, sizeof(ag_res));
+ ag_res.state = 0;
+ BTA_AgResult (btif_hf_cb.handle, BTA_AG_BVRA_RES, &ag_res);
- return BT_STATUS_SUCCESS;
+ return BT_STATUS_SUCCESS;
+ }
+ else
+ {
+ return BT_STATUS_UNSUPPORTED;
+ }
}
- return BT_STATUS_FAIL;
+ return BT_STATUS_NOT_READY;
}
/*******************************************************************************