diff --git a/android/bluetooth.c b/android/bluetooth.c
index 4e4397a..dfc929d 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
eir_data_free(&eir);
/* Notify Gatt if its registered for LE events */
- if (bdaddr_type != BDADDR_BREDR && gatt_device_found_cb)
- gatt_device_found_cb(bdaddr, bdaddr_type, rssi, data_len, data);
+ if (bdaddr_type != BDADDR_BREDR && gatt_device_found_cb) {
+ bool discoverable;
+
+ discoverable = eir.flags & (EIR_LIM_DISC | EIR_GEN_DISC);
+
+ gatt_device_found_cb(bdaddr, bdaddr_type, rssi, data_len, data,
+ discoverable);
+ }
if (dev->bond_state != HAL_BOND_STATE_BONDED)
cache_device(dev);
diff --git a/android/bluetooth.h b/android/bluetooth.h
index 8dbc623..807ebe7 100644
--- a/android/bluetooth.h
+++ b/android/bluetooth.h
typedef void (*bt_le_device_found)(const bdaddr_t *addr, uint8_t addr_type,
int rssi, uint16_t eir_len,
- const void *eir);
+ const void *eir, bool discoverable);
bool bt_le_discovery_start(bt_le_device_found cb);
typedef void (*bt_le_discovery_stopped)(void);
diff --git a/android/gatt.c b/android/gatt.c
index 12c35ca..e74a60c 100644
--- a/android/gatt.c
+++ b/android/gatt.c
static void le_device_found_handler(const bdaddr_t *addr, uint8_t addr_type,
int rssi, uint16_t eir_len,
- const void *eir)
+ const void *eir,
+ bool discoverable)
{
uint8_t buf[IPC_MTU];
struct hal_ev_gatt_client_scan_result *ev = (void *) buf;
char bda[18];
- if (!scanning)
+ if (!scanning || !discoverable)
goto connect;
ba2str(addr, bda);