summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-10-31 02:05:54 +0100
committerLennart Poettering <lennart@poettering.net>2009-11-11 05:15:40 +0100
commit70da8d65d4dc138e162cd3d2649048a8664c85e5 (patch)
tree11547d6a073261287ca808a9f385b0e603400474
parentbfb17357cdda34d3595ebd573b04adb5b80489f2 (diff)
bluetooth: do not hand out access to devices that are not fully configured yet
-rw-r--r--src/modules/bluetooth/bluetooth-util.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index f8c5b778..47d62005 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -723,12 +723,14 @@ const pa_bluetooth_device* pa_bluetooth_discovery_get_by_address(pa_bluetooth_di
while ((d = pa_hashmap_iterate(y->devices, &state, NULL)))
if (pa_streq(d->address, address))
- return d;
+ return device_is_audio(d) ? d : NULL;
return NULL;
}
const pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_discovery *y, const char* path) {
+ pa_bluetooth_device *d;
+
pa_assert(y);
pa_assert(PA_REFCNT_VALUE(y) > 0);
pa_assert(path);
@@ -736,7 +738,11 @@ const pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_disco
if (!pa_hook_is_firing(&y->hook))
pa_bluetooth_discovery_sync(y);
- return pa_hashmap_get(y->devices, path);
+ if ((d = pa_hashmap_get(y->devices, path)))
+ if (device_is_audio(d))
+ return d;
+
+ return NULL;
}
static int setup_dbus(pa_bluetooth_discovery *y) {