Revert "Fix: ConnectProfiles never be returned" 03/216303/1 accepted/tizen/unified/20191101.042116 submit/tizen/20191031.005137
authorDeokhyun Kim <dukan.kim@samsung.com>
Wed, 23 Oct 2019 07:01:42 +0000 (16:01 +0900)
committerDeokhyun Kim <dukan.kim@samsung.com>
Wed, 23 Oct 2019 07:01:42 +0000 (16:01 +0900)
This reverts commit 1d77526f4dad3e322504a780770836129931796a

When prior connection fails, dev->connect was not released
Release connect resources when connection fails

// First connect
Oct 17 14:30:55 localhost bluetoothd[6459]: src/device.c:connect_profiles() /org/bluez/hci0/dev_XX_XX_XX_XX_EB_3C 0000111e-0000-1000-8000-00805f9b34fb, client :1.18
Oct 17 14:31:00 localhost bluetoothd[6459]: src/device.c:device_profile_connected() Hands-Free Audio Gateway Host is down (112)
Oct 17 14:31:00 localhost bluetoothd[6459]: src/device.c:connect_profiles() /org/bluez/hci0/dev_XX_XX_XX_XX_EB_3C 0000110b-0000-1000-8000-00805f9b34fb, client :1.18
Oct 17 14:31:01 localhost bluetoothd[6459]: src/device.c:device_profile_connected() a2dp-sink Resource temporarily unavailable (11)

// Second connect
Oct 17 14:32:10 localhost bluetoothd[6459]: src/device.c:connect_profiles() /org/bluez/hci0/dev_XX_XX_XX_XX_EB_3C 0000111e-0000-1000-8000-00805f9b34fb, client :1.18
10-17 14:32:10.327+0900 E/BLUETOOTH_FRWK_SERVICE(P 2694, T 2694): bt-service-audio.c: __bt_audio_request_cb(781) > Audio Connect/Disconnect Dbus Call Error: GDBus.Error:org.bluez.Error.InProgress: In Progress

Change-Id: I8caa4f43f51a7b302b5afc8a5028a22776d97cf5
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
src/device.c

index 7705f57..460dca8 100644 (file)
@@ -2073,10 +2073,8 @@ static void device_profile_connected(struct btd_device *dev,
        if (!err)
                btd_device_set_temporary(dev, false);
 
-#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
        if (dev->pending == NULL)
                goto done;
-#endif
 
        if (!btd_device_is_connected(dev)) {
                switch (-err) {
@@ -2087,11 +2085,6 @@ static void device_profile_connected(struct btd_device *dev,
                }
        }
 
-#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
-       if (dev->pending == NULL)
-               return;
-#endif
-
        pending = dev->pending->data;
        l = find_service_with_profile(dev->pending, profile);
        if (l != NULL)