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

Commit 8dd4a191 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Clean up calls in GsmCdmaCallTracker on GSM<->CDMA transitions.

Bug: 29972199
Change-Id: I2df4264a97239d6c87378ebae8e30abd8de6af0f
parent a2dfbf36
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -189,6 +189,10 @@ public class GsmCdmaCallTracker extends CallTracker {
                gsmCdmaConnection.dispose();
            }
        }

        mConnections = null;
        mPendingMO = null;
        mState = PhoneConstants.State.IDLE;
    }

    @Override
+3 −0
Original line number Diff line number Diff line
@@ -215,6 +215,9 @@ public class GsmCdmaConnection extends Connection {

    public void dispose() {
        clearPostDialListeners();
        if (mParent != null) {
            mParent.detach(this);
        }
        releaseAllWakeLocks();
    }

+12 −0
Original line number Diff line number Diff line
@@ -358,6 +358,18 @@ public class GsmCdmaCallTrackerTest extends TelephonyTest {

        // verify getCurrentCalls is called on updating phone type
        verify(mSimulatedCommandsVerifier, times(2)).getCurrentCalls(any(Message.class));

        // verify that if phone type is updated, calls and callTracker go to idle
        testMOCallPickUp();

        // update phone type
        mCTUT.updatePhoneType();

        // verify CT and calls go to idle
        assertEquals(PhoneConstants.State.IDLE, mCTUT.getState());
        assertEquals(GsmCdmaCall.State.IDLE, mCTUT.mForegroundCall.getState());
        assertEquals(GsmCdmaCall.State.IDLE, mCTUT.mBackgroundCall.getState());
        assertEquals(GsmCdmaCall.State.IDLE, mCTUT.mRingingCall.getState());
    }
}