Search in sources :

Example 21 with ImsCall

use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.

the class ImsCallTest method testSetLteNoWifi.

@Test
@SmallTest
public void testSetLteNoWifi() {
    ImsCall mTestImsCall = new ImsCall(mContext, mTestCallProfile);
    assertFalse(mTestImsCall.isWifiCall());
    assertNotEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
    mBundle.putInt(ImsCallProfile.EXTRA_CALL_NETWORK_TYPE, TelephonyManager.NETWORK_TYPE_LTE);
    assertFalse(mTestImsCall.isWifiCall());
    assertEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
}
Also used : ImsCall(com.android.ims.ImsCall) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 22 with ImsCall

use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.

the class ImsCallTest method testSetLteNoWifiAlt.

@Test
@SmallTest
public void testSetLteNoWifiAlt() {
    ImsCall mTestImsCall = new ImsCall(mContext, mTestCallProfile);
    assertFalse(mTestImsCall.isWifiCall());
    assertNotEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
    mBundle.putString(ImsCallProfile.EXTRA_CALL_RAT_TYPE_ALT, ServiceState.RIL_RADIO_TECHNOLOGY_LTE + "");
    assertFalse(mTestImsCall.isWifiCall());
    assertEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
}
Also used : ImsCall(com.android.ims.ImsCall) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 23 with ImsCall

use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.

the class ImsCallTest method testSetWifiAlt.

@Test
@SmallTest
public void testSetWifiAlt() {
    ImsCall mTestImsCall = new ImsCall(mContext, mTestCallProfile);
    assertFalse(mTestImsCall.isWifiCall());
    assertNotEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
    mBundle.putString(ImsCallProfile.EXTRA_CALL_RAT_TYPE_ALT, ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN + "");
    assertTrue(mTestImsCall.isWifiCall());
    assertNotEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
}
Also used : ImsCall(com.android.ims.ImsCall) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 24 with ImsCall

use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.

the class ImsCallTest method testSetWifiDeprecated.

@Test
@SmallTest
public void testSetWifiDeprecated() {
    ImsCall mTestImsCall = new ImsCall(mContext, mTestCallProfile);
    assertFalse(mTestImsCall.isWifiCall());
    assertNotEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
    // use deprecated API
    mBundle.putString(ImsCallProfile.EXTRA_CALL_RAT_TYPE, ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN + "");
    assertTrue(mTestImsCall.isWifiCall());
    assertNotEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
}
Also used : ImsCall(com.android.ims.ImsCall) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 25 with ImsCall

use of com.android.ims.ImsCall in project android_frameworks_opt_telephony by LineageOS.

the class ImsCallTest method testSetWifi.

@Test
@SmallTest
public void testSetWifi() {
    ImsCall mTestImsCall = new ImsCall(mContext, mTestCallProfile);
    assertFalse(mTestImsCall.isWifiCall());
    assertNotEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
    mBundle.putInt(ImsCallProfile.EXTRA_CALL_NETWORK_TYPE, TelephonyManager.NETWORK_TYPE_IWLAN);
    assertTrue(mTestImsCall.isWifiCall());
    assertNotEquals(mTestImsCall.getNetworkType(), TelephonyManager.NETWORK_TYPE_LTE);
}
Also used : ImsCall(com.android.ims.ImsCall) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

ImsCall (com.android.ims.ImsCall)48 ImsException (com.android.ims.ImsException)19 SmallTest (android.test.suitebuilder.annotation.SmallTest)16 CallStateException (com.android.internal.telephony.CallStateException)16 TelephonyTest (com.android.internal.telephony.TelephonyTest)16 Test (org.junit.Test)16 ImsCallProfile (android.telephony.ims.ImsCallProfile)8 FlakyTest (androidx.test.filters.FlakyTest)8 RemoteException (android.os.RemoteException)6 Connection (com.android.internal.telephony.Connection)5 ImsPhoneCall (com.android.internal.telephony.imsphone.ImsPhoneCall)5 ImsPhone (com.android.internal.telephony.imsphone.ImsPhone)4 ImsReasonInfo (android.telephony.ims.ImsReasonInfo)3 ImsMultiEndpoint (com.android.ims.ImsMultiEndpoint)3 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)3 Bundle (android.os.Bundle)2 PersistableBundle (android.os.PersistableBundle)2 TestConferenceEventPackageParser (com.android.internal.telephony.test.TestConferenceEventPackageParser)2 File (java.io.File)2 FileInputStream (java.io.FileInputStream)2