summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-09-06 02:55:27 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2009-09-06 02:56:37 +0300
commit04394771451b4fd89501dd665f1f0d2cefb4f05a (patch)
tree29767c711ea2b597b9ebe353844305d841ca3964
parent74624288fb67b31e99fdf9a44db19055340815f0 (diff)
downloadbluez-04394771451b4fd89501dd665f1f0d2cefb4f05a.tar.gz
Fix audio device authorized setting for AVRCP-only connections
AVRCP state isn't hooked up to the generic audio interface and its state changes so it needs to clear the authorized variable when getting disconnected if no other profile is active.
-rw-r--r--audio/control.c4
-rw-r--r--audio/device.c7
-rw-r--r--audio/device.h2
3 files changed, 13 insertions, 0 deletions
diff --git a/audio/control.c b/audio/control.c
index c8a93f914..e94ef562d 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -427,6 +427,10 @@ static void avctp_set_state(struct control *control, avctp_state_t new_state)
emit_property_changed(dev->conn, dev->path,
AUDIO_CONTROL_INTERFACE, "Connected",
DBUS_TYPE_BOOLEAN, &value);
+
+ if (!audio_device_is_active(dev, NULL))
+ audio_device_set_authorized(dev, FALSE);
+
break;
case AVCTP_STATE_CONNECTING:
debug("AVCTP Connecting");
diff --git a/audio/device.c b/audio/device.c
index 104c256cf..550a35f17 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -804,3 +804,10 @@ int audio_device_cancel_authorization(struct audio_device *dev,
return 0;
}
+
+void audio_device_set_authorized(struct audio_device *dev, gboolean auth)
+{
+ struct dev_priv *priv = dev->priv;
+
+ priv->authorized = auth;
+}
diff --git a/audio/device.h b/audio/device.h
index 45c54e80a..c899d20b2 100644
--- a/audio/device.h
+++ b/audio/device.h
@@ -90,3 +90,5 @@ int audio_device_cancel_authorization(struct audio_device *dev,
int audio_device_request_authorization(struct audio_device *dev,
const char *uuid, authorization_cb cb,
void *user_data);
+
+void audio_device_set_authorized(struct audio_device *dev, gboolean auth);