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.
diff --git a/audio/control.c b/audio/control.c
index c8a93f9..e94ef56 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -427,6 +427,10 @@
 		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 104c256..550a35f 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -804,3 +804,10 @@
 
 	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 45c54e8..c899d20 100644
--- a/audio/device.h
+++ b/audio/device.h
@@ -90,3 +90,5 @@
 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);