OSDN Git Service

Cancel inquiry during the transition from Bluetooth off to LE on state
authorNitin Arora <niarora@codeaurora.org>
Thu, 30 Apr 2015 19:07:43 +0000 (12:07 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Thu, 7 May 2015 04:35:58 +0000 (21:35 -0700)
This change cancels any inquiry or device discovery that is ongoing
while Bluetooth transitions from BT_ON state to BLE_ON state, before
disabling all core services.

Change-Id: I3f14b6a1f6629c60c897ab39e49c44516400d737

src/com/android/bluetooth/btservice/AdapterProperties.java

index af8fd35..242e271 100644 (file)
@@ -643,6 +643,8 @@ class AdapterProperties {
         debugLog("onBluetoothDisable()");
         mBluetoothDisabling = true;
         if (getState() == BluetoothAdapter.STATE_TURNING_OFF) {
+            // Turn off any Device Search/Inquiry
+            mService.cancelDiscovery();
             setScanMode(AbstractionLayer.BT_SCAN_MODE_NONE);
         }
     }