aboutsummaryrefslogtreecommitdiffstats
path: root/java/direct_bt/tinyb/DBTAdapter.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-01-17 18:56:02 +0100
committerSven Gothel <[email protected]>2021-01-17 18:56:02 +0100
commit30b4e5f0c1f62c92c40a6ccceda8878f88a9521a (patch)
treef932f2366a47d847ef4b4813c3a49d685c2351a1 /java/direct_bt/tinyb/DBTAdapter.java
parenta93f3bd05b075095eebe44ec7784c1664dc68700 (diff)
AdapterStatusListener::deviceFound: Resolve sharedDevices persistence of found device via return value
While we keep the device instance temporarily alive within discoveredDevices until next removeDiscoveredDevices() eg at startDiscover(), we only keep it within persistent sharedDevices list if at least one deviceFound implementation returns true. This allows user to minimize the sharedDevices footprint when rejecting the device w/o being required to call device.remove().
Diffstat (limited to 'java/direct_bt/tinyb/DBTAdapter.java')
-rw-r--r--java/direct_bt/tinyb/DBTAdapter.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/java/direct_bt/tinyb/DBTAdapter.java b/java/direct_bt/tinyb/DBTAdapter.java
index b8ae955d..ab1d25fd 100644
--- a/java/direct_bt/tinyb/DBTAdapter.java
+++ b/java/direct_bt/tinyb/DBTAdapter.java
@@ -537,13 +537,14 @@ public class DBTAdapter extends DBTObject implements BluetoothAdapter
}
}
@Override
- public void deviceFound(final BluetoothDevice device, final long timestamp) {
+ public boolean deviceFound(final BluetoothDevice device, final long timestamp) {
if( DEBUG ) {
System.err.println("Adapter.FOUND: "+device+" on "+device.getAdapter());
}
synchronized(discoveredDevicesLock) {
discoveredDevices.add(device);
}
+ return false;
}
@Override