Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb7eeb8a authored by Raphael Kim's avatar Raphael Kim
Browse files

[CDM] Fix a bug where turning off Bluetooth before CDM BLE device discovery...

[CDM] Fix a bug where turning off Bluetooth before CDM BLE device discovery timeout results in a crash.

Bug: 427498880
Test: Manual test on CompanionDeviceTestApp (replaced with BLE scan)
Flag: EXEMPT bug fix
Change-Id: I48efc1279f7406b141d60d3931c7b61116c5c0f3
parent e6529e0c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -277,7 +277,12 @@ public class CompanionDeviceDiscoveryService extends Service {

        // Stop BLE scanning.
        if (mBleScanCallback != null) {
            try {
                mBleScanner.stopScan(mBleScanCallback);
            } catch (IllegalStateException e) {
                Slog.e(TAG, "Unable to stop BLE scanner. The scanner is already"
                        + " turned off or Bluetooth is disabled.");
            }
        }

        Handler.getMain().removeCallbacks(mSoftTimeoutRunnable);