Diff between 7c9d237105bcbca8aa0eb932dfbeb8a2623c1ca3 and 85e82427f01a52c0aa7ce410cfb212defe9502e7

Changed Files

File Additions Deletions Status
android/bluetooth.c +2 -1 modified
android/bluetooth.h +2 -1 modified
android/gatt.c +3 -3 modified

Full Patch

diff --git a/android/bluetooth.c b/android/bluetooth.c
index 379d8ea..93b9cd7 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -1503,7 +1503,8 @@ static void update_found_device(const bdaddr_t *bdaddr, uint8_t bdaddr_type,
 		discoverable = eir.flags & (EIR_LIM_DISC | EIR_GEN_DISC);
 
 		gatt_device_found_cb(bdaddr, bdaddr_type, rssi, data_len, data,
-								discoverable);
+								discoverable,
+								dev->le_bonded);
 	}
 
 	if (!dev->bredr_paired && !dev->le_paired)
diff --git a/android/bluetooth.h b/android/bluetooth.h
index 6a3e766..a0b81a6 100644
--- a/android/bluetooth.h
+++ b/android/bluetooth.h
@@ -37,7 +37,8 @@ void bt_adapter_remove_record(uint32_t handle);
 
 typedef void (*bt_le_device_found)(const bdaddr_t *addr, uint8_t addr_type,
 					int rssi, uint16_t eir_len,
-					const void *eir, bool discoverable);
+					const void *eir, bool discoverable,
+					bool bonded);
 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 89da60d..66328e2 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -907,15 +907,15 @@ static struct service *create_service(uint8_t id, bool primary, char *uuid,
 
 static void le_device_found_handler(const bdaddr_t *addr, uint8_t addr_type,
 						int rssi, uint16_t eir_len,
-							const void *eir,
-							bool discoverable)
+						const void *eir,
+						bool discoverable, bool bonded)
 {
 	uint8_t buf[IPC_MTU];
 	struct hal_ev_gatt_client_scan_result *ev = (void *) buf;
 	struct gatt_device *dev;
 	char bda[18];
 
-	if (!scanning || !discoverable)
+	if (!scanning || (!discoverable && !bonded))
 		goto connect;
 
 	ba2str(addr, bda);