From 2d7e1873d10cd53256754ecc2c4ab8401db0316e Mon Sep 17 00:00:00 2001 From: Dan Harms Date: Tue, 6 Aug 2019 09:18:02 -0700 Subject: Include BLE<->SPP transition states in isLeEnabled Fixes: 138997297 Test: Start scan while in transition and observe no exceptions Change-Id: Ib8b05c30c3db8e398194572a179028647e703a9f --- core/java/android/bluetooth/BluetoothAdapter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 39d63de87da3..e7ba85ad5d9e 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -858,7 +858,10 @@ public final class BluetoothAdapter { if (DBG) { Log.d(TAG, "isLeEnabled(): " + BluetoothAdapter.nameForState(state)); } - return (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_BLE_ON); + return (state == BluetoothAdapter.STATE_ON + || state == BluetoothAdapter.STATE_BLE_ON + || state == BluetoothAdapter.STATE_TURNING_ON + || state == BluetoothAdapter.STATE_TURNING_OFF); } /** -- cgit v1.2.3-59-g8ed1b