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

Commit 80585f69 authored by Jo De Boeck's avatar Jo De Boeck
Browse files

Profiles: Fix turning bluetooth on/off when its in intermediate state

Change-Id: I09213c987580f47a6c3618edb469edabda96230c
parent b429a083
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -112,10 +112,12 @@ public final class ConnectionSettings implements Parcelable {
                }
                break;
            case PROFILE_CONNECTION_BLUETOOTH:
                currentState = bta.isEnabled();
                if (forcedState && !currentState) {
                int btstate = bta.getState();
                if (forcedState && (btstate == BluetoothAdapter.STATE_OFF
                        || btstate == BluetoothAdapter.STATE_TURNING_OFF)) {
                    bta.enable();
                } else if (!forcedState && currentState) {
                } else if (!forcedState && (btstate == BluetoothAdapter.STATE_ON
                        || btstate == BluetoothAdapter.STATE_TURNING_ON)) {
                    bta.disable();
                }
                break;