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

Commit 05a03451 authored by David van Tonder's avatar David van Tonder Committed by Gerrit Code Review
Browse files

Merge "Profiles: Fix turning bluetooth on/off when its in intermediate state" into cm-10.1

parents e48fce6d 80585f69
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;