summaryrefslogtreecommitdiffstats
path: root/java/direct_bt/tinyb/DBTAdapter.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/direct_bt/tinyb/DBTAdapter.java')
-rw-r--r--java/direct_bt/tinyb/DBTAdapter.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/java/direct_bt/tinyb/DBTAdapter.java b/java/direct_bt/tinyb/DBTAdapter.java
index aa49a3f1..637fec05 100644
--- a/java/direct_bt/tinyb/DBTAdapter.java
+++ b/java/direct_bt/tinyb/DBTAdapter.java
@@ -318,11 +318,10 @@ public class DBTAdapter extends DBTObject implements BluetoothAdapter
@Override
public boolean startDiscovery(final boolean keepAlive) throws BluetoothException {
synchronized( discoveryLock ) {
- if( !isDiscovering.get() ) {
- removeDevices();
- return startDiscoveryImpl(keepAlive); // event callbacks will be generated by implementation
- }
- return true;
+ // Ignoring 'isDiscovering', as native implementation also handles change of 'keepAlive'.
+ // The discoveredDevices shall always get cleared.
+ removeDevices();
+ return startDiscoveryImpl(keepAlive); // event callbacks will be generated by implementation
}
}
private native boolean startDiscoveryImpl(boolean keepAlive) throws BluetoothException;