Search in sources :

Example 31 with ImsManager

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

the class ImsManagerTest method testSetValues.

@Test
@SmallTest
public void testSetValues() {
    ImsManager imsManager = getImsManagerAndInitProvisionedValues();
    imsManager.setWfcMode(ImsConfig.WfcModeFeatureValueConstants.CELLULAR_PREFERRED);
    verify(mSubscriptionController, times(1)).setSubscriptionProperty(eq(mSubId[0]), eq(SubscriptionManager.WFC_IMS_MODE), eq("1"));
    imsManager.setWfcMode(ImsConfig.WfcModeFeatureValueConstants.CELLULAR_PREFERRED, true);
    verify(mSubscriptionController, times(1)).setSubscriptionProperty(eq(mSubId[0]), eq(SubscriptionManager.WFC_IMS_ROAMING_MODE), eq("1"));
    imsManager.setVtSetting(false);
    verify(mSubscriptionController, times(1)).setSubscriptionProperty(eq(mSubId[0]), eq(SubscriptionManager.VT_IMS_ENABLED), eq("0"));
    // enhanced 4g mode must be editable to use setEnhanced4gLteModeSetting
    mBundle.putBoolean(CarrierConfigManager.KEY_EDITABLE_ENHANCED_4G_LTE_BOOL, ENHANCED_4G_MODE_EDITABLE);
    imsManager.setEnhanced4gLteModeSetting(true);
    verify(mSubscriptionController, times(1)).setSubscriptionProperty(eq(mSubId[0]), eq(SubscriptionManager.ENHANCED_4G_MODE_ENABLED), eq("1"));
    imsManager.setWfcSetting(true);
    verify(mSubscriptionController, times(1)).setSubscriptionProperty(eq(mSubId[0]), eq(SubscriptionManager.WFC_IMS_ENABLED), eq("1"));
}
Also used : ImsManager(com.android.ims.ImsManager) TelephonyTest(com.android.internal.telephony.TelephonyTest) SmallTest(androidx.test.filters.SmallTest) Test(org.junit.Test) SmallTest(androidx.test.filters.SmallTest)

Aggregations

ImsManager (com.android.ims.ImsManager)31 SmallTest (androidx.test.filters.SmallTest)18 TelephonyTest (com.android.internal.telephony.TelephonyTest)18 Test (org.junit.Test)18 Mockito.anyString (org.mockito.Mockito.anyString)11 Intent (android.content.Intent)3 ExecutionException (java.util.concurrent.ExecutionException)3 TimeoutException (java.util.concurrent.TimeoutException)3 PendingIntent (android.app.PendingIntent)2 CarrierConfigManager (android.telephony.CarrierConfigManager)2 AsyncResult (android.os.AsyncResult)1 Message (android.os.Message)1 PersistableBundle (android.os.PersistableBundle)1 RegistrantList (android.os.RegistrantList)1 PhoneAccountHandle (android.telecom.PhoneAccountHandle)1 BarringInfo (android.telephony.BarringInfo)1 ImsConfigImplBase (android.telephony.ims.stub.ImsConfigImplBase)1 Pair (android.util.Pair)1 GsmMmiCode (com.android.internal.telephony.gsm.GsmMmiCode)1 SuppServiceNotification (com.android.internal.telephony.gsm.SuppServiceNotification)1