- if (_bt_headset_get_local_connection() == FALSE) {
- if (restricted == 0x0) /* not restricted*/
- _bt_start_timer_for_connection(address, BT_AUDIO_HSP);
- } else {
- /* Connection Started from local device therefore no need to
- * intiate connection for pending profile */
- _bt_headset_set_local_connection(FALSE);
- }
- param = g_variant_new("(is)", result, address);
- _bt_send_event(BT_HEADSET_EVENT, event,
- param);
- connected = _bt_is_headset_type_connected(BT_AUDIO_A2DP,
- connected_address);
- if (connected) {
- if (g_strcmp0(connected_address, address) != 0) {
- _bt_convert_addr_string_to_type(
- device_address.addr,
- connected_address);
- _bt_audio_disconnect(0, BT_AUDIO_A2DP,
- &device_address, NULL);
+ if (_bt_headset_get_local_connection() == FALSE) {
+ if (restricted == 0x0) /* not restricted*/
+ _bt_start_timer_for_connection(address, BT_AUDIO_HSP);
+ } else {
+ /* Connection Started from local device therefore no need to
+ * intiate connection for pending profile */
+ _bt_headset_set_local_connection(FALSE);
+ }
+ param = g_variant_new("(is)", result, address);
+ _bt_send_event(BT_HEADSET_EVENT, event,
+ param);
+ connected = _bt_is_headset_type_connected(BT_AUDIO_A2DP,
+ connected_address);
+ if (connected) {
+ if (g_strcmp0(connected_address, address) != 0) {
+ _bt_convert_addr_string_to_type(
+ device_address.addr,
+ connected_address);
+ _bt_audio_disconnect(0, BT_AUDIO_A2DP,
+ &device_address, NULL);
+ }