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

Commit cdd45734 authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "Pandora: Listen of BLE_STATE_CHANGED" into main

parents e7723a20 b43bbd06
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ class Host(

        // Add all intent actions to be listened.
        val intentFilter = IntentFilter()
        intentFilter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED)
        intentFilter.addAction(BluetoothAdapter.ACTION_BLE_STATE_CHANGED)
        intentFilter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED)
        intentFilter.addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED)
        intentFilter.addAction(BluetoothDevice.ACTION_PAIRING_REQUEST)
@@ -147,7 +147,7 @@ class Host(

        val stateFlow =
            flow
                .filter { it.getAction() == BluetoothAdapter.ACTION_STATE_CHANGED }
                .filter { it.getAction() == BluetoothAdapter.ACTION_BLE_STATE_CHANGED }
                .map { it.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR) }

        if (bluetoothAdapter.isEnabled) {
@@ -173,7 +173,7 @@ class Host(

            val stateFlow =
                flow
                    .filter { it.getAction() == BluetoothAdapter.ACTION_STATE_CHANGED }
                    .filter { it.getAction() == BluetoothAdapter.ACTION_BLE_STATE_CHANGED }
                    .map { it.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR) }

            initiatedConnection.clear()