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

Commit 4b299be8 authored by zhenchao's avatar zhenchao Committed by Gerrit - the friendly Code Review server
Browse files

Bluetooth: ignore connection state change while BT OFF

In some conditions, connection status is not correct
in paired device list after BT turn off and turn on
again. Ignore profile connection state change broadcast
during BT state is STATE_TURNING_OFF or STATE_OFF.

Change-Id: I9669b494e5106f14b8a711ac39271c971898a801
CRs-Fixed: 1088259
parent cb4d2efb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -126,7 +126,9 @@ public final class CachedBluetoothDevice implements Comparable<CachedBluetoothDe
            Log.d(TAG, "onProfileStateChanged: profile " + profile +
                    " newProfileState " + newProfileState);
        }
        if (mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_TURNING_OFF)
        int bluetoothState = mLocalAdapter.getBluetoothState();
        if (bluetoothState == BluetoothAdapter.STATE_TURNING_OFF ||
                bluetoothState == BluetoothAdapter.STATE_OFF)
        {
            if (Utils.D) Log.d(TAG, " BT Turninig Off...Profile conn state change ignored...");
            return;