Loading system/btif/src/btif_hf.cc +20 −0 Original line number Diff line number Diff line Loading @@ -1034,6 +1034,25 @@ static bt_status_t set_sco_allowed(bool value) { return BT_STATUS_SUCCESS; } static bt_status_t send_bsir(bool value, RawAddress* bd_addr) { CHECK_BTHF_INIT(); int idx = btif_hf_idx_by_bdaddr(bd_addr); if ((idx < 0) || (idx >= BTIF_HF_NUM_CB)) { BTIF_TRACE_ERROR("%s: Invalid index %d for %s", __func__, idx, bd_addr->ToString().c_str()); return BT_STATUS_FAIL; } if (!is_connected(bd_addr)) { BTIF_TRACE_ERROR("%s: Device not connected %s", __func__, bd_addr->ToString().c_str()); return BT_STATUS_FAIL; } tBTA_AG_RES_DATA ag_result = {}; ag_result.state = value; BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_INBAND_RING_RES, &ag_result); return BT_STATUS_SUCCESS; } /******************************************************************************* * * Function formatted_at_response Loading Loading @@ -1453,6 +1472,7 @@ static const bthf_interface_t bthfInterface = { phone_state_change, cleanup, set_sco_allowed, send_bsir, }; /******************************************************************************* Loading system/include/hardware/bt_hf.h +9 −0 Original line number Diff line number Diff line Loading @@ -319,6 +319,15 @@ typedef struct { /** Whether we will initiate SCO or not **/ bt_status_t (*set_sco_allowed)(bool value); /** * Send +BSIR response code to enable/disable in-band ringtone in an active * HFP service level connection * * @param value true for enabled, false for disable * @param bd_addr remote device address */ bt_status_t (*send_bsir)(bool value, RawAddress* bd_addr); } bthf_interface_t; __END_DECLS Loading Loading
system/btif/src/btif_hf.cc +20 −0 Original line number Diff line number Diff line Loading @@ -1034,6 +1034,25 @@ static bt_status_t set_sco_allowed(bool value) { return BT_STATUS_SUCCESS; } static bt_status_t send_bsir(bool value, RawAddress* bd_addr) { CHECK_BTHF_INIT(); int idx = btif_hf_idx_by_bdaddr(bd_addr); if ((idx < 0) || (idx >= BTIF_HF_NUM_CB)) { BTIF_TRACE_ERROR("%s: Invalid index %d for %s", __func__, idx, bd_addr->ToString().c_str()); return BT_STATUS_FAIL; } if (!is_connected(bd_addr)) { BTIF_TRACE_ERROR("%s: Device not connected %s", __func__, bd_addr->ToString().c_str()); return BT_STATUS_FAIL; } tBTA_AG_RES_DATA ag_result = {}; ag_result.state = value; BTA_AgResult(btif_hf_cb[idx].handle, BTA_AG_INBAND_RING_RES, &ag_result); return BT_STATUS_SUCCESS; } /******************************************************************************* * * Function formatted_at_response Loading Loading @@ -1453,6 +1472,7 @@ static const bthf_interface_t bthfInterface = { phone_state_change, cleanup, set_sco_allowed, send_bsir, }; /******************************************************************************* Loading
system/include/hardware/bt_hf.h +9 −0 Original line number Diff line number Diff line Loading @@ -319,6 +319,15 @@ typedef struct { /** Whether we will initiate SCO or not **/ bt_status_t (*set_sco_allowed)(bool value); /** * Send +BSIR response code to enable/disable in-band ringtone in an active * HFP service level connection * * @param value true for enabled, false for disable * @param bd_addr remote device address */ bt_status_t (*send_bsir)(bool value, RawAddress* bd_addr); } bthf_interface_t; __END_DECLS Loading