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

Commit 8c94165d authored by Tyler Gunn's avatar Tyler Gunn Committed by Android Git Automerger
Browse files

am aa479376: Fixing where call goes from disconnecting to active to disconnecting state.

* commit 'aa479376':
  Fixing where call goes from disconnecting to active to disconnecting state.
parents 83b39a07 aa479376
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -297,6 +297,8 @@ final class Call implements CreateConnectionResponse {
    // switches every time the user hits "swap".
    private Call mConferenceLevelActiveCall = null;

    private boolean mIsLocallyDisconnecting = false;

    /**
     * Persists the specified parameters and initializes the new instance.
     *
@@ -744,6 +746,9 @@ final class Call implements CreateConnectionResponse {
     * Attempts to disconnect the call through the connection service.
     */
    void disconnect() {
        // Track that the call is now locally disconnecting.
        setLocallyDisconnecting(true);

        if (mState == CallState.NEW || mState == CallState.PRE_DIAL_WAIT ||
                mState == CallState.CONNECTING) {
            Log.v(this, "Aborting call %s", this);
@@ -1282,6 +1287,24 @@ final class Call implements CreateConnectionResponse {
        mIsUnknown = isUnknown;
    }

    /**
     * Determines if this call is in a disconnecting state.
     *
     * @return {@code true} if this call is locally disconnecting.
     */
    public boolean isLocallyDisconnecting() {
        return mIsLocallyDisconnecting;
    }

    /**
     * Sets whether this call is in a disconnecting state.
     *
     * @param isLocallyDisconnecting {@code true} if this call is locally disconnecting.
     */
    private void setLocallyDisconnecting(boolean isLocallyDisconnecting) {
        mIsLocallyDisconnecting = isLocallyDisconnecting;
    }

    static int getStateFromConnectionState(int state) {
        switch (state) {
            case Connection.STATE_INITIALIZING:
+2 −0
Original line number Diff line number Diff line
@@ -443,6 +443,8 @@ public final class InCallController extends CallsManagerListenerBase {
        int state = call.getState();
        if (state == CallState.ABORTED) {
            state = CallState.DISCONNECTED;
        } else if (call.isLocallyDisconnecting()) {
            state = CallState.DISCONNECTING;
        }

        String parentCallId = null;