diff --git a/android/bluetooth.c b/android/bluetooth.c
index 06bb9bf..690aaf6 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
HAL_EV_REMOTE_DEVICE_PROPS, size, buf);
}
+static bool is_new_device(const struct device *dev)
+{
+ if (!dev)
+ return true;
+
+ if (dev->found)
+ return false;
+
+ if (adapter.cur_discovery_type != SCAN_TYPE_DUAL)
+ return false;
+
+ if (dev->bond_state == HAL_BOND_STATE_BONDED)
+ return false;
+
+ return true;
+}
+
static void update_found_device(const bdaddr_t *bdaddr, uint8_t bdaddr_type,
int8_t rssi, bool confirm,
const uint8_t *data, uint8_t data_len)
/* Device found event needs to be send also for known device if this is
* new discovery session. Otherwise framework will ignore it.
*/
- if (!dev || !dev->found) {
+ if (is_new_device(dev)) {
if (!dev)
dev = create_device(bdaddr, bdaddr_type);