summaryrefslogtreecommitdiffstats
path: root/audio/device.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-10-23 07:54:36 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-10-23 07:54:36 +0000
commit0ad3f2251089e00a57b6aa6def396e24f30ab1e4 (patch)
tree378fa05c2215381f82271ebec4f45762ec971665 /audio/device.c
parentb636ccf2c9c5f5c7419c49c556b118930012d2e7 (diff)
Integrate AVRCP further with the rest of the audio service
Diffstat (limited to 'audio/device.c')
-rw-r--r--audio/device.c9
1 files changed, 9 insertions, 0 deletions
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;
}