summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2020-06-03 01:27:01 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-06-03 01:27:01 +0000
commit6e97539ea40f3954e2c6c080ffae9b3be9594c19 (patch)
tree74a8d5947fd71a70fea97724fc8f1f2c58aaceae
parenta3aac62786131253d595577eb198b740fd17fcca (diff)
parentf7065dc95213df91e631eb7689e25cc5f4378476 (diff)
Merge "Disable Bluetooth if BLE was disabled while enabling" into rvc-dev
-rw-r--r--services/core/java/com/android/server/BluetoothManagerService.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index 3c0d880916ee..0d4efed25da3 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -954,7 +954,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
}
/**
- * Call IBluetooth.onLeServiceUp() to continue if Bluetooth should be on.
+ * Call IBluetooth.onLeServiceUp() to continue if Bluetooth should be on,
+ * call IBluetooth.onBrEdrDown() to disable if Bluetooth should be off.
*/
private void continueFromBleOnState() {
if (DBG) {
@@ -966,11 +967,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Slog.e(TAG, "onBluetoothServiceUp: mBluetooth is null!");
return;
}
- if (!mEnableExternal && !isBleAppPresent() && isAirplaneModeOn()) {
- // Airplane mode is turned on while enabling BLE only mode, disable
- // BLE now.
- disableBleScanMode();
- sendBrEdrDownCallback();
+ if (!mEnableExternal && !isBleAppPresent()) {
+ Slog.i(TAG, "Bluetooth was disabled while enabling BLE, disable BLE now");
+ mEnable = false;
+ mBluetooth.onBrEdrDown();
return;
}
if (isBluetoothPersistedStateOnBluetooth() || !isBleAppPresent()) {