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

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

Merge "Fix abnormal state of ImsPhoneCall after hangup"

parents c56a7070 0fc2f4d7
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -199,7 +199,9 @@ public class ImsPhoneCall extends Call {
            }

            if (hasOnlyDisconnectedConnections) {
                synchronized(this) {
                    mState = State.DISCONNECTED;
                }
                if (VDBG) {
                    Rlog.v(LOG_TAG, "connectionDisconnected : " + mCallContext + " state = " +
                            mState);
@@ -235,13 +237,17 @@ public class ImsPhoneCall extends Call {
     * Called when this Call is being hung up locally (eg, user pressed "end")
     */
    @UnsupportedAppUsage
    void
    onHangupLocal() {
    @VisibleForTesting
    public void onHangupLocal() {
        for (int i = 0, s = mConnections.size(); i < s; i++) {
            ImsPhoneConnection cn = (ImsPhoneConnection)mConnections.get(i);
            cn.onHangupLocal();
        }
        synchronized(this) {
            if (mState.isAlive()) {
                mState = State.DISCONNECTING;
            }
        }
        if (VDBG) {
            Rlog.v(LOG_TAG, "onHangupLocal : " + mCallContext + " state = " + mState);
        }
+2 −1
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@ public class ImsPhoneCallTest extends TelephonyTest {
    }

    @FlakyTest
    @Ignore
    @Test
    @SmallTest
    public void testConnectionDisconnected() {
@@ -106,6 +105,8 @@ public class ImsPhoneCallTest extends TelephonyTest {
        doReturn(Call.State.DISCONNECTED).when(mConnection2).getState();
        mImsCallUT.connectionDisconnected(null);
        assertEquals(Call.State.DISCONNECTED, mImsCallUT.getState());
        mImsCallUT.onHangupLocal();
        assertEquals(Call.State.DISCONNECTED, mImsCallUT.getState());
    }

    @FlakyTest