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

Commit 1282f0f2 authored by Mengjun Leng's avatar Mengjun Leng
Browse files

Fix conference call cannot be hung up

If requesting to hold the conference and immediately hang up it,
the foreground conference actually is not complete to be held,
so that the wrong hang-up command is sent to lower layer.

Bug: 80280674
Change-Id: If352e34a818181e9e3e17cf45b1c36b6184e9483
parent 22f7e88f
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -47,6 +47,18 @@ public abstract class Call {
        }
    }

    public enum HoldingRequestState {
        NONE, STARTED, ENDED;

        public boolean isStarted() {
            return this == STARTED;
        }

        public boolean isFinished() {
            return this == ENDED;
        }
    }

    public static State
    stateFromDCState (DriverCall.State dcState) {
        switch (dcState) {
@@ -70,6 +82,8 @@ public abstract class Call {

    public ArrayList<Connection> mConnections = new ArrayList<Connection>();

    public HoldingRequestState mHoldingRequestState = HoldingRequestState.NONE;

    /* Instance Methods */

    /** Do not modify the List result!!! This list is not yours to keep
@@ -277,4 +291,8 @@ public abstract class Call {
    protected void setState(State newState) {
        mState = newState;
    }

    public void updateHoldingRequestState(HoldingRequestState state) {
        mHoldingRequestState = state;
    }
}
+4 −1
Original line number Diff line number Diff line
@@ -118,6 +118,9 @@ public class GsmCdmaCall extends Call {
        newState = stateFromDCState(dc.state);

        if (newState != mState) {
            if (mState == State.HOLDING) {
                updateHoldingRequestState(HoldingRequestState.ENDED);
            }
            mState = newState;
            changed = true;
        }
+6 −0
Original line number Diff line number Diff line
@@ -1260,6 +1260,12 @@ public class GsmCdmaCallTracker extends CallTracker {
                // Do not auto-answer ringing on CHUP, instead just end active calls
                log("hangup all conns in active/background call, without affecting ringing call");
                hangupAllConnections(call);
            } else if (call.mHoldingRequestState.isStarted()) {
                // Even if the progress of holding is not completed, lower layer expects to hang up
                // as background call because of being going to holding.
                log("hangup waiting or background call");
                logHangupEvent(call);
                hangupWaitingOrBackground();
            } else {
                logHangupEvent(call);
                hangupForegroundResumeBackground();