summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothAdapter.java
diff options
context:
space:
mode:
authorCalvin On <con@google.com>2016-06-15 17:58:23 -0700
committerAndre Eisenbach <eisenbach@google.com>2016-06-17 21:18:21 +0000
commit20f11b34f738d5586e0ad6b1cd50bbe4239de58d (patch)
tree042c4b5755d93b423389f029c426b0b1344d3537 /framework/java/android/bluetooth/BluetoothAdapter.java
parentc5ad1f87b25822ff086c75f5c165d131db0251da (diff)
Fix race with BT disable in BLE_ON_STATE
This will restart the BT stack when it detects a transition into OFF state while the user enable flag (mEnable) is set. Bug: 29363429 Change-Id: I9839119b34c4694ad92e96240c6989008b2f8d52
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothAdapter.java18
1 files changed, 0 insertions, 18 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java
index 9390bcd13d..47ae68796f 100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -897,28 +897,10 @@ public final class BluetoothAdapter {
*/
@RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
public boolean enable() {
- int state = BluetoothAdapter.STATE_OFF;
if (isEnabled() == true) {
if (DBG) Log.d(TAG, "enable(): BT is already enabled..!");
return true;
}
- // Use service interface to get the exact state
- try {
- mServiceLock.readLock().lock();
- if (mService != null) {
- state = mService.getState();
- }
- } catch (RemoteException e) {
- Log.e(TAG, "", e);
- } finally {
- mServiceLock.readLock().unlock();
- }
-
- if (state == BluetoothAdapter.STATE_BLE_ON) {
- Log.e(TAG, "BT is in BLE_ON State");
- notifyUserAction(true);
- return true;
- }
try {
return mManagerService.enable();
} catch (RemoteException e) {Log.e(TAG, "", e);}