diff options
| author | 2011-08-10 19:04:00 -0700 | |
|---|---|---|
| committer | 2011-08-10 19:04:00 -0700 | |
| commit | 10fc9bc55ef26e7e61db47986d559889668ae55e (patch) | |
| tree | 88c65f0a610db044492bb6a6fdbf65e3f414c895 | |
| parent | c5708036b47c474ad3a01dacc3c3940e087d6e27 (diff) | |
Revert "Implement switchConnectable with Powered property setting instead of scan modes"
This reverts commit c5708036b47c474ad3a01dacc3c3940e087d6e27
| -rwxr-xr-x | core/java/android/server/BluetoothService.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index 9548839b4cc0..28546dce0ed6 100755 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -748,13 +748,18 @@ public class BluetoothService extends IBluetooth.Stub { /** * @param on true set the local Bluetooth module to be connectable - * The dicoverability is recovered to what it was before - * switchConnectable(false) call + * but not dicoverable * false set the local Bluetooth module to be not connectable * and not dicoverable */ /*package*/ synchronized void switchConnectable(boolean on) { - setAdapterPropertyBooleanNative("Powered", on ? 1 : 0); + if (on) { + // 0 is a dummy value, does not apply for SCAN_MODE_CONNECTABLE + setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE, 0, false); + } else { + // 0 is a dummy value, does not apply for SCAN_MODE_NONE + setScanMode(BluetoothAdapter.SCAN_MODE_NONE, 0, false); + } } private synchronized boolean setScanMode(int mode, int duration, boolean allowOnlyInOnState) { |