diff options
| author | Matthew Xie <mattx@google.com> | 2013-05-08 19:26:57 -0700 |
|---|---|---|
| committer | Matthew Xie <mattx@google.com> | 2013-05-08 19:26:57 -0700 |
| commit | c3ef4fc08a0381c13161d681fe7364d82876216a (patch) | |
| tree | 382bcef424fc5fc3a694be0294e34f6b0b73f42d /framework/java/android/bluetooth/BluetoothDevice.java | |
| parent | c4ae982d5a2c6ee720a7895a7780ce34ac849c14 (diff) | |
Donot bind to GATT service when BLE is not supported
bug 8664724
Change-Id: I9b9222cd5877babcded73798a5d1ff13fd10e791
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothDevice.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothDevice.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java index 3c1ec90f19..79a5ffea46 100644 --- a/framework/java/android/bluetooth/BluetoothDevice.java +++ b/framework/java/android/bluetooth/BluetoothDevice.java @@ -1187,6 +1187,10 @@ public final class BluetoothDevice implements Parcelable { IBluetoothManager managerService = adapter.getBluetoothManager(); try { IBluetoothGatt iGatt = managerService.getBluetoothGatt(); + if (iGatt == null) { + // BLE is not supported + return null; + } BluetoothGatt gatt = new BluetoothGatt(context, iGatt, this); gatt.connect(autoConnect, callback); return gatt; |
