diff --git a/android/bluetooth.c b/android/bluetooth.c
index aee0c56..041f922 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
return false;
}
+static void cancel_pending_confirm_name(gpointer data, gpointer user_data)
+{
+ struct device *dev = data;
+
+ mgmt_cancel(mgmt_if, dev->confirm_id);
+ dev->confirm_id = 0;
+}
+
static bool stop_discovery(void)
{
struct mgmt_cp_stop_discovery cp;
DBG("type=0x%x", cp.type);
+ /* Lets drop all confirm name request as we don't need it anymore */
+ g_slist_foreach(cached_devices, cancel_pending_confirm_name, NULL);
+
if (mgmt_send(mgmt_if, MGMT_OP_STOP_DISCOVERY, adapter.index,
sizeof(cp), &cp, NULL, NULL, NULL) > 0)
return true;