Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge "Make Bluetooth discoverability timeout configurable (also supp…

…orting infinite timeout)." into froyo
  • Loading branch information...
commit de14df24cbb91095a2f03fa51f8f9293072ab3f4 2 parents c0b870d + 62be861
@cyanogen cyanogen authored Gerrit Code Review committed
Showing with 7 additions and 3 deletions.
  1. +7 −3 core/java/android/server/BluetoothService.java
View
10 core/java/android/server/BluetoothService.java
@@ -999,9 +999,13 @@ public synchronized boolean setScanMode(int mode, int duration) {
mHandler.removeMessages(MESSAGE_DISCOVERABLE_TIMEOUT);
pairable = true;
discoverable = true;
- Message msg = mHandler.obtainMessage(MESSAGE_DISCOVERABLE_TIMEOUT);
- mHandler.sendMessageDelayed(msg, duration * 1000);
- if (DBG) Log.d(TAG, "BT Discoverable for " + duration + " seconds");
+ if (duration != 0) {
+ Message msg = mHandler.obtainMessage(MESSAGE_DISCOVERABLE_TIMEOUT);
+ mHandler.sendMessageDelayed(msg, duration * 1000);
+ if (DBG) Log.d(TAG, "BT Discoverable for " + duration + " seconds");
+ } else {
+ if (DBG) Log.d(TAG, "BT Discoverable infinitely");
+ }
break;
default:
Log.w(TAG, "Requested invalid scan mode " + mode);
Please sign in to comment.
Something went wrong with that request. Please try again.