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

Commit a4ed11ee authored by joonhunshin's avatar joonhunshin
Browse files

Update unit test to verify the media type of accept when answering via MMI code

Bug: 286499659
Test: atest ImsPhoneTest
Change-Id: I53fb04881fc81b88edfa2d2cdc251df629c88d16
parent b08868ba
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.PersistableBundle;
import android.sysprop.TelephonyProperties;
import android.telecom.VideoProfile;
import android.telephony.CarrierConfigManager;
import android.telephony.ServiceState;
import android.telephony.SubscriptionInfo;
@@ -284,6 +285,14 @@ public class ImsPhoneTest extends TelephonyTest {
        doReturn(Call.State.INCOMING).when(mRingingCall).getState();
        assertEquals(true, mImsPhoneUT.handleInCallMmiCommands("2"));
        verify(mImsCT).acceptCall(ImsCallProfile.CALL_TYPE_VOICE);

        // Verify b/286499659, fixed media type
        doReturn(true).when(mFeatureFlags).answerAudioOnlyWhenAnsweringViaMmiCode();
        doReturn(Call.State.IDLE).when(mForegroundCall).getState();
        doReturn(Call.State.IDLE).when(mBackgroundCall).getState();
        doReturn(Call.State.INCOMING).when(mRingingCall).getState();
        assertEquals(true, mImsPhoneUT.handleInCallMmiCommands("2"));
        verify(mImsCT).acceptCall(VideoProfile.STATE_AUDIO_ONLY);
    }

    @Test