switch (service_id) {
case A2DP_SERVICE_ID:
- if (TIZEN_FEATURE_FHUB_REFERENCE)
+ if (TIZEN_FEATURE_FHUB_REFERENCE) {
+ if (_bt_audio_get_current_role() == BLUETOOTH_A2DP_SOURCE) {
+ BT_INFO("Current local A2DP role is Source.. reject [%s] device authorization request with [%d]",
+ address, service_id);
+ res = device_reply_auth_request((bt_address_t*)&device_address, service_id, FALSE, FALSE);
+ if (res != OAL_STATUS_SUCCESS)
+ BT_ERR("authorize_response: %d", res);
+ return;
+ }
+
connected = _bt_is_headset_type_connected(BT_AUDIO_A2DP_SOURCE, connected_address);
- else
+ } else
connected = _bt_is_headset_type_connected(BT_AUDIO_A2DP, connected_address);
if (connected) {
return result;
}
+int _bt_audio_get_current_role(void)
+{
+ return curr_audio_role;
+}
+
int _bt_hf_disconnect(bluetooth_device_address_t *device_address)
{
int result = BLUETOOTH_ERROR_NONE;
return;
}
+ if (TIZEN_FEATURE_FHUB_REFERENCE) {
+ if (service_id == HFP_HS_SERVICE_ID || service_id == AVRCP_SERVICE_ID) {
+ if (curr_audio_role != BLUETOOTH_A2DP_SINK) {
+ BT_INFO("Current local A2DP role is Source.. reject [%s] device authorization request with [%d]",
+ address, service_id);
+ res = device_reply_auth_request((bt_address_t*)&device_address, service_id, FALSE, FALSE);
+ if (res != OAL_STATUS_SUCCESS)
+ BT_ERR("authorize_response: %d", res);
+ return;
+ }
+ }
+ }
+
if (connected) {
BT_INFO("[%d] device is already connected..check which device..", service_id);
if (g_strcmp0(connected_address, address) != 0) {