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

Commit 7808d9bd authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Include Video history in Rejected calls

Change the disconnected state logic to include rejected
calls as a criteria to log video history.

Bug: 63000001
Test: Manual, Telecom Unit Tests
Change-Id: Ib62046819a36a29b67632459328eb8644b02398a
parent 8e3d34e4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -807,7 +807,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable {
                fixParentAfterDisconnect();
            }
            if (mState == CallState.DISCONNECTED &&
                    mDisconnectCause.getCode() == DisconnectCause.MISSED) {
                    (mDisconnectCause.getCode() == DisconnectCause.MISSED ||
                            mDisconnectCause.getCode() == DisconnectCause.REJECTED)) {
                // Ensure when an incoming call is missed that the video state history is updated.
                mVideoStateHistory |= mVideoState;
            }
+32 −0
Original line number Diff line number Diff line
@@ -870,6 +870,38 @@ public class BasicCallTests extends TelecomSystemTest {
        assertEquals(VideoProfile.STATE_BIDIRECTIONAL, call.getVideoState());
    }

    /**
     * Ensure that when an incoming video call is missed, the video state history still includes
     * video calling. This is important for the call log.
     */
    @LargeTest
    public void testIncomingVideoCallMissedCheckVideoHistory() throws Exception {
        IdPair ids = startIncomingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                VideoProfile.STATE_BIDIRECTIONAL, mConnectionServiceFixtureA);
        com.android.server.telecom.Call call = mTelecomSystem.getCallsManager().getCalls()
                .iterator().next();

        mConnectionServiceFixtureA.sendSetDisconnected(ids.mConnectionId, DisconnectCause.MISSED);

        assertTrue(VideoProfile.isVideo(call.getVideoStateHistory()));
    }

    /**
     * Ensure that when an incoming video call is rejected, the video state history still includes
     * video calling. This is important for the call log.
     */
    @LargeTest
    public void testIncomingVideoCallRejectedCheckVideoHistory() throws Exception {
        IdPair ids = startIncomingPhoneCall("650-555-1212", mPhoneAccountA0.getAccountHandle(),
                VideoProfile.STATE_BIDIRECTIONAL, mConnectionServiceFixtureA);
        com.android.server.telecom.Call call = mTelecomSystem.getCallsManager().getCalls()
                .iterator().next();

        mConnectionServiceFixtureA.sendSetDisconnected(ids.mConnectionId, DisconnectCause.REJECTED);

        assertTrue(VideoProfile.isVideo(call.getVideoStateHistory()));
    }

    /**
     * Test scenario where the user starts an outgoing video call with no selected PhoneAccount, and
     * then subsequently selects a PhoneAccount which does not support video calling.