From: Mikel Astiz Date: Fri, 11 Jan 2013 10:07:47 +0000 (+0100) Subject: bluetooth: Do not check profile states is device_audio_is_ready() X-Git-Tag: v3.99.1~188 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8eb3d14b137e47ae68a0d87e4d22295885ec367d;p=platform%2Fupstream%2Fpulseaudio.git bluetooth: Do not check profile states is device_audio_is_ready() The function is used to make sure some basic information has already been gathered before the device is being used. At this point profile states can be ignored, since their initial value will be PA_BT_AUDIO_STATE_INVALID and thus effectively similar to PA_BT_AUDIO_STATE_DISCONNECTED due to audio_state_to_transport_state(). The change should make no difference given that the behavior of pa_bluetooth_device_any_audio_connected() doesn't change: by the time TRUE is returned, a transport needs to exist. This means a profile will exist in CONNECTING or CONNECTED state and thus the old implementation of device_audio_is_ready() would also have returned TRUE. --- diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c index 066c82c..149a476 100644 --- a/src/modules/bluetooth/bluetooth-util.c +++ b/src/modules/bluetooth/bluetooth-util.c @@ -235,18 +235,12 @@ static void device_free(pa_bluetooth_device *d) { } static pa_bool_t device_is_audio_ready(const pa_bluetooth_device *d) { - unsigned i; - pa_assert(d); if (!d->device_info_valid || d->audio_state == PA_BT_AUDIO_STATE_INVALID) return false; - for (i = 0; i < PA_BLUETOOTH_PROFILE_COUNT; i++) - if (d->profile_state[i] != PA_BT_AUDIO_STATE_INVALID) - return true; - - return false; + return true; } static const char *check_variant_property(DBusMessageIter *i) {