diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2011-02-01 14:12:24 -0800 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2011-05-27 13:06:45 -0700 |
commit | e984291f8f78432bcd033b831124f9533b36d5aa (patch) | |
tree | 27bc94b6c9f8578a84322a2c4f22e6fdbd5c9325 | |
parent | c7b87766b21fe5cf2f644efa8753b936d413dc9a (diff) | |
download | base-e984291f8f78432bcd033b831124f9533b36d5aa.tar.gz |
Remove discoverable timeout handler. DO NOT MERGE
This is leftover code from bluez3 days. We get a property change
in Bluez4 and an intent is sent.
Change-Id: I94c57cdebe4a990846a0733a9a71cabc820419e4
-rw-r--r-- | core/java/android/server/BluetoothService.java | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index 4d4d30904932..c2710212e148 100644 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -103,7 +103,6 @@ public class BluetoothService extends IBluetooth.Stub { private static final int MESSAGE_REGISTER_SDP_RECORDS = 1; private static final int MESSAGE_FINISH_DISABLE = 2; private static final int MESSAGE_UUID_INTENT = 3; - private static final int MESSAGE_DISCOVERABLE_TIMEOUT = 4; private static final int MESSAGE_AUTO_PAIRING_FAILURE_ATTEMPT_DELAY = 5; // The time (in millisecs) to delay the pairing attempt after the first @@ -501,15 +500,6 @@ public class BluetoothService extends IBluetooth.Stub { makeServiceChannelCallbacks(address); } break; - case MESSAGE_DISCOVERABLE_TIMEOUT: - int mode = msg.arg1; - if (isEnabledInternal()) { - // TODO: Switch back to the previous scan mode - // This is ok for now, because we only use - // CONNECTABLE and CONNECTABLE_DISCOVERABLE - setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE, -1); - } - break; case MESSAGE_AUTO_PAIRING_FAILURE_ATTEMPT_DELAY: address = (String)msg.obj; if (address != null) { @@ -1078,21 +1068,17 @@ public class BluetoothService extends IBluetooth.Stub { switch (mode) { case BluetoothAdapter.SCAN_MODE_NONE: - mHandler.removeMessages(MESSAGE_DISCOVERABLE_TIMEOUT); pairable = false; discoverable = false; break; case BluetoothAdapter.SCAN_MODE_CONNECTABLE: - mHandler.removeMessages(MESSAGE_DISCOVERABLE_TIMEOUT); pairable = true; discoverable = false; break; case BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE: - mHandler.removeMessages(MESSAGE_DISCOVERABLE_TIMEOUT); + setDiscoverableTimeout(duration); 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"); break; default: |