summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2010-12-17 13:22:36 +0000
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2010-12-17 13:22:36 +0000
commitde14df24cbb91095a2f03fa51f8f9293072ab3f4 (patch)
treed85696802fcc64f6329382118f5514098bc7ef4e
parentc0b870db917db767932cbe9f79eb62d637ebe27d (diff)
parent62be861edf86c05efff58eb3092938385297accd (diff)
downloadframeworks_base-de14df24cbb91095a2f03fa51f8f9293072ab3f4.zip
frameworks_base-de14df24cbb91095a2f03fa51f8f9293072ab3f4.tar.gz
frameworks_base-de14df24cbb91095a2f03fa51f8f9293072ab3f4.tar.bz2
Merge "Make Bluetooth discoverability timeout configurable (also supporting infinite timeout)." into froyo
-rw-r--r--core/java/android/server/BluetoothService.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index 33bcfcd..4fce943 100644
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -999,9 +999,13 @@ public class BluetoothService extends IBluetooth.Stub {
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);