summaryrefslogtreecommitdiffstats
path: root/java/direct_bt
diff options
context:
space:
mode:
Diffstat (limited to 'java/direct_bt')
-rw-r--r--java/direct_bt/tinyb/DBTAdapter.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/java/direct_bt/tinyb/DBTAdapter.java b/java/direct_bt/tinyb/DBTAdapter.java
index 4f0d1025..4cbc071f 100644
--- a/java/direct_bt/tinyb/DBTAdapter.java
+++ b/java/direct_bt/tinyb/DBTAdapter.java
@@ -429,6 +429,10 @@ public class DBTAdapter extends DBTObject implements BluetoothAdapter
if( DEBUG ) {
System.err.println("Adapter.StatusListener.DISCOVERING: enabled "+enabled+", keepAlive "+keepAlive+" on "+adapter);
}
+ if( !enabled && keepAlive ) {
+ // Don't update isDiscovering:=false and don't notify user IF keepAlive!
+ return;
+ }
if( isDiscovering.compareAndSet(!enabled, enabled) ) {
synchronized(userCallbackLock) {
if( null != userDiscoveringNotificationCB ) {