summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHermann Czedik-Eysenberg <git-dev@hermann.czedik.net>2010-12-08 15:08:26 +0100
committerHermann Czedik-Eysenberg <git-dev@hermann.czedik.net>2010-12-08 15:08:26 +0100
commit62be861edf86c05efff58eb3092938385297accd (patch)
tree938485601648e2982558230e9776f130d69cc213
parent42b7da86499e4b36ed2343618abf4b18e3b6f117 (diff)
downloadframeworks_base-62be861edf86c05efff58eb3092938385297accd.zip
frameworks_base-62be861edf86c05efff58eb3092938385297accd.tar.gz
frameworks_base-62be861edf86c05efff58eb3092938385297accd.tar.bz2
Make Bluetooth discoverability timeout configurable (also supporting infinite timeout).
This fixes http://code.google.com/p/cyanogenmod/issues/detail?id=2597 Change-Id: Ifa390856b27dfb123e8addfae2bbb721e61e91f8
-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);