- /*Check for any OPP transfer on the device and cancel
- * the transfer
- */
- _bt_obex_check_pending_transfer(address);
- _bt_opp_client_is_sending(&sending);
- if(sending == TRUE)
- _bt_opp_client_check_pending_transfer(address);
+ if (!addr_type) {
+#ifdef TIZEN_BT_A2DP_SINK_AUTO_CONNECT
+ {
+ int bt_device_state = VCONFKEY_BT_DEVICE_NONE;
+
+ if (vconf_get_int(VCONFKEY_BT_DEVICE, &bt_device_state) != 0)
+ BT_ERR("vconf_get_int failed");
+
+ BT_INFO("conn_state[0x%x], adapter_state [%d]",
+ bt_device_state, _bt_adapter_get_status());
+
+ if (disc_reason == BLUETOOTH_ERROR_CONNECTION_TIMEOUT) {
+ _bt_audio_start_auto_connect(TRUE);
+ } else if (bt_device_state &
+ VCONFKEY_BT_DEVICE_A2DP_SOURCE_CONNECTED) {
+ BT_INFO("Disconnected due to turning BT off. Skip a address");
+ } else {
+ char *last_connected = NULL;
+ last_connected = vconf_get_str(BT_LAST_CONNECTED_DEVICE);
+ if (!g_strcmp0(address, last_connected))
+ _bt_audio_set_auto_connect_device_addr("");
+ if (last_connected)
+ free(last_connected);
+ }
+ }
+
+#endif
+ /*Check for any OPP transfer on the device and cancel
+ * the transfer
+ */
+ _bt_obex_check_pending_transfer(address);
+ _bt_opp_client_is_sending(&sending);
+ if (sending == TRUE)
+ _bt_opp_client_check_pending_transfer(address);
+ }