diff options
Diffstat (limited to 'service/java/com')
| -rw-r--r-- | service/java/com/android/server/bluetooth/BluetoothManagerService.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/service/java/com/android/server/bluetooth/BluetoothManagerService.java b/service/java/com/android/server/bluetooth/BluetoothManagerService.java index 0f8db2e656..037cef554e 100644 --- a/service/java/com/android/server/bluetooth/BluetoothManagerService.java +++ b/service/java/com/android/server/bluetooth/BluetoothManagerService.java @@ -217,6 +217,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { mBluetoothLock.readLock().lock(); if (mBluetooth != null) { mBluetooth.onBrEdrDown(); + mEnable = false; mEnableExternal = false; } } catch (RemoteException e) { @@ -445,14 +446,16 @@ class BluetoothManagerService extends IBluetoothManager.Stub { class ClientDeathRecipient implements IBinder.DeathRecipient { public void binderDied() { - if (DBG) Slog.d(TAG, "Binder is dead - unregister Ble App"); + if (DBG) Slog.d(TAG, "Binder is dead - unregister Ble App"); if (mBleAppCount > 0) --mBleAppCount; if (mBleAppCount == 0) { if (DBG) Slog.d(TAG, "Disabling LE only mode after application crash"); try { mBluetoothLock.readLock().lock(); - if (mBluetooth != null) { + if (mBluetooth != null && + mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) { + mEnable = false; mBluetooth.onBrEdrDown(); } } catch (RemoteException e) { @@ -469,6 +472,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub { @Override public boolean isBleScanAlwaysAvailable() { + if (isAirplaneModeOn() && !mEnable) { + return false; + } try { return (Settings.Global.getInt(mContentResolver, Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE)) != 0; |
