bluetooth: Remove device_is_audio_ready()
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Fri, 11 Jan 2013 10:07:48 +0000 (11:07 +0100)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 11 Jan 2013 19:51:10 +0000 (21:51 +0200)
commit241059de7069911f41f1c0299b4a1cad4fa575cc
tree6ca2e16aa8768a27a506b17dc4139d6f2892fc43
parent8eb3d14b137e47ae68a0d87e4d22295885ec367d
bluetooth: Remove device_is_audio_ready()

The function was used to check whether the basic properties of the
Bluetooth device have been received. This can be simplified by just
checking d->device_info_valid, since the state of the audio interface
is only relevant inside pa_bluetooth_device_any_audio_connected(), which
is used to trigger the discovery callback.

While checking device_info_valid, special care must be taken with all
three possible values: when set to -1, it means some error was triggered
while getting the device properties. Therefore, these devices can also
be ignored outside bluetooth-util.

Besides that, the patch slightly modifies the behavior of the internal
API affecting pa_bluetooth_discovery_get_by_address() and
pa_bluetooth_discovery_get_by_path(), since they will return the device
no matter the state of the audio interface. This however makes sense and
should have no influence in the current codebase given that the modules
make use of devices only after the discovery hook has been triggered.
src/modules/bluetooth/bluetooth-util.c