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

Commit 1d557b64 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "PBAP: Return correct connection state when state machine is done"

parents 86ddcab0 79c63000
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -347,7 +347,18 @@ class PbapStateMachine extends StateMachine {
        }
    }

    /**
     * Get the current connection state of this state machine
     *
     * @return current connection state, one of {@link BluetoothProfile#STATE_DISCONNECTED},
     * {@link BluetoothProfile#STATE_CONNECTING}, {@link BluetoothProfile#STATE_CONNECTED}, or
     * {@link BluetoothProfile#STATE_DISCONNECTING}
     */
    synchronized int getConnectionState() {
        return ((PbapStateBase) getCurrentState()).getConnectionStateInt();
        PbapStateBase state = (PbapStateBase) getCurrentState();
        if (state == null) {
            return BluetoothProfile.STATE_DISCONNECTED;
        }
        return state.getConnectionStateInt();
    }
}