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

Commit 11089428 authored by Aishwarya Mallampati's avatar Aishwarya Mallampati
Browse files

Check Wi-Fi call is possible or not in ImsPhone.

Bug: 318871716
Test: atest ImsPhoneTest
Test Request Bug: 320807503

Change-Id: Ie85e65eba48a793bc50fa78fb8a7c40b2e51d9c0
parent eaed9899
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2832,6 +2832,15 @@ public class ImsPhone extends ImsPhoneBase {
        mCT.triggerNotifyAnbr(mediaType, direction, bitsPerSecond);
    }

    /**
     * Check whether making a call using Wi-Fi is possible or not.
     * @return {code true} if IMS is registered over IWLAN else return {code false}.
     */
    public boolean canMakeWifiCall() {
        return isImsRegistered() && (getImsRegistrationTech()
                == ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN);
    }

    @Override
    public void dump(FileDescriptor fd, PrintWriter printWriter, String[] args) {
        IndentingPrintWriter pw = new IndentingPrintWriter(printWriter, "  ");
+11 −0
Original line number Diff line number Diff line
@@ -1603,6 +1603,17 @@ public class ImsPhoneTest extends TelephonyTest {
        assertEquals(2, copiedDialArgs.eccCategory);
    }

    @Test
    @SmallTest
    public void testCanMakeWifiCall() {
        mImsPhoneUT.setServiceState(ServiceState.STATE_IN_SERVICE);
        mImsPhoneUT.setImsRegistered(true);
        doReturn(ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN).when(mImsCT)
                .getImsRegistrationTech();

        assertTrue(mImsPhoneUT.canMakeWifiCall());
    }

    private ServiceState getServiceStateDataAndVoice(int rat, int regState, boolean isRoaming) {
        ServiceState ss = new ServiceState();
        ss.setStateOutOfService();