From 0ad3f2251089e00a57b6aa6def396e24f30ab1e4 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 23 Oct 2007 07:54:36 +0000 Subject: Integrate AVRCP further with the rest of the audio service --- audio/device.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'audio/device.c') diff --git a/audio/device.c b/audio/device.c index 9b76e019..a2047b9e 100644 --- a/audio/device.c +++ b/audio/device.c @@ -49,6 +49,7 @@ #include "ipc.h" #include "device.h" #include "avdtp.h" +#include "control.h" #include "headset.h" #include "sink.h" @@ -185,6 +186,9 @@ static void device_free(struct device *dev) if (dev->sink) sink_free(dev); + if (dev->control) + control_free(dev); + if (dev->conn) dbus_connection_unref(dev->conn); @@ -486,6 +490,8 @@ uint8_t device_get_state(struct device *dev) hs_state = headset_get_state(dev); return hs_to_ipc_state(hs_state); } + else if (dev->control && control_is_active(dev)) + return STATE_CONNECTED; return STATE_DISCONNECTED; } @@ -509,6 +515,9 @@ gboolean device_is_connected(struct device *dev, const char *interface) else if (!strcmp(interface, AUDIO_HEADSET_INTERFACE) && dev->headset && headset_is_active(dev)) return TRUE; + else if (!strcmp(interface, AUDIO_CONTROL_INTERFACE) && dev->headset && + control_is_active(dev)) + return TRUE; return FALSE; } -- cgit