diff options
Diffstat (limited to 'audio/manager.c')
-rw-r--r-- | audio/manager.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/audio/manager.c b/audio/manager.c index 242f16bb..18ef9eb4 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -1164,9 +1164,7 @@ static void auth_cb(DBusError *derr, void *user_data) error("Access denied: %s", derr->message); if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY)) { debug("Canceling authorization request"); - if (service_cancel_auth(&device->dst) < 0) - manager_cancel_authorize(&device->dst, uuid, - NULL); + service_cancel_auth(&device->src, &device->dst); } headset_set_state(device, HEADSET_STATE_DISCONNECTED); @@ -1219,9 +1217,13 @@ static void ag_io_cb(GIOChannel *chan, int err, const bdaddr_t *src, goto drop; } - if (!service_req_auth(&device->src, &device->dst, uuid, auth_cb, - device) == 0) + err = service_req_auth(&device->src, &device->dst, uuid, auth_cb, + device); + if (err < 0) { + debug("Authorization denied: %s", strerror(-err)); headset_close_rfcomm(device); + return; + } headset_set_state(device, HEADSET_STATE_CONNECT_IN_PROGRESS); |