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

Commit 853e0d20 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Add fix for picking correct Handover connection"

parents 417714fb 9f7d8084
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -96,9 +96,15 @@ public abstract class CallTracker extends Handler {

    protected Connection getHoConnection(DriverCall dc) {
        for (Connection hoConn : mHandoverConnections) {
            log("getHoConnection: hoConn= " + hoConn.toString());
            if (hoConn.getState() == Call.stateFromDCState(dc.state)
                    || (hoConn.getAddress() != null && hoConn.getAddress().contains(dc.number))) {
            log("getHoConnection - compare number: hoConn= " + hoConn.toString());
            if (hoConn.getAddress() != null && hoConn.getAddress().contains(dc.number)) {
                log("getHoConnection: Handover connection match found = " + hoConn.toString());
                return hoConn;
            }
        }
        for (Connection hoConn : mHandoverConnections) {
            log("getHoConnection: compare state hoConn= " + hoConn.toString());
            if (hoConn.getStateBeforeHandover() == Call.stateFromDCState(dc.state)) {
                log("getHoConnection: Handover connection match found = " + hoConn.toString());
                return hoConn;
            }
+9 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ public abstract class Connection {
    private int mAudioQuality;
    private int mCallSubstate;
    private android.telecom.Connection.VideoProvider mVideoProvider;
    public Call.State mPreHandoverState = Call.State.IDLE;

    /* Instance Methods */

@@ -263,6 +264,14 @@ public abstract class Connection {
        }
    }

    /**
     * If this connection went through handover return the state of the
     * call that contained this connection before handover.
     */
    public Call.State getStateBeforeHandover() {
        return mPreHandoverState;
    }

    /**
     * Get the extras for the connection's call.
     *
+6 −0
Original line number Diff line number Diff line
@@ -1407,6 +1407,12 @@ public final class ImsPhoneCallTracker extends CallTracker {
    }

    private void transferHandoverConnections(ImsPhoneCall call) {
        if (call.mConnections != null) {
            for (Connection c : call.mConnections) {
                c.mPreHandoverState = call.mState;
                log ("Connection state before handover is " + c.getStateBeforeHandover());
            }
        }
        if (mHandoverCall.mConnections == null ) {
            mHandoverCall.mConnections = call.mConnections;
        } else { // Multi-call SRVCC