diff --git a/android/bluetooth.c b/android/bluetooth.c
index cd1772a..aaba585 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
static struct ipc *hal_ipc = NULL;
+static bool kernel_conn_control = false;
+
static void get_device_android_addr(struct device *dev, uint8_t *addr)
{
/*
return true;
}
+bool bt_kernel_conn_control(void)
+{
+ return kernel_conn_control;
+}
+
static bool rssi_above_threshold(int old, int new)
{
/* only 8 dBm or more */
goto failed;
}
+ /* Starting from mgmt 1.7, kernel can handle connection control */
+ if (MGMT_VERSION(mgmt_version, mgmt_revision) >= MGMT_VERSION(1, 7)) {
+ info("Kernel connection control will be used");
+ kernel_conn_control = true;
+ }
+
mgmt_register(mgmt_if, MGMT_EV_INDEX_ADDED, MGMT_INDEX_NONE,
mgmt_index_added_event, cb, NULL);
mgmt_register(mgmt_if, MGMT_EV_INDEX_REMOVED, MGMT_INDEX_NONE,
diff --git a/android/bluetooth.h b/android/bluetooth.h
index e00634c..adad6c4 100644
--- a/android/bluetooth.h
+++ b/android/bluetooth.h
uint16_t bt_get_gatt_ccc(const bdaddr_t *addr);
const bdaddr_t *bt_get_id_addr(const bdaddr_t *addr, uint8_t *type);
+
+bool bt_kernel_conn_control(void);