Merge "Send hci command to disable scan mode in power down function"
diff --git a/src/device.c b/src/device.c
old mode 100644
new mode 100755
index 8805c27..8728644
--- a/src/device.c
+++ b/src/device.c
@@ -2146,10 +2146,12 @@
if (auth && auth->type == AUTH_TYPE_NOTIFY && auth->agent)
agent_cancel(auth->agent);
- if (status == 0x06) {
+ // Temporary hack till we move to mgmt interface.
+ if (status == 0x06 && auth == NULL) {
device_remove_bonding(device);
device_get_address(device, &bdaddr);
btd_adapter_retry_authentication(device->adapter, &bdaddr);
+ return;
} else if (status) {
device_cancel_authentication(device, TRUE);
device_cancel_bonding(device, status);