Search in sources :

Example 1 with RegistrationCallback

use of android.telephony.ims.RegistrationManager.RegistrationCallback in project android_frameworks_opt_telephony by LineageOS.

the class ImsRegistrationCallbackHelperTest method testImsOnRegistering.

@Test
@SmallTest
public void testImsOnRegistering() {
    // Verify the RegistrationCallback should not be null
    RegistrationCallback callback = mRegistrationCallbackHelper.getCallback();
    assertNotNull(callback);
    // When onRegistering is called, the registration state should be
    // REGISTRATION_STATE_REGISTERING
    callback.onRegistering(AccessNetworkType.IWLAN);
    // The registration state should be REGISTRATION_STATE_REGISTERING
    assertEquals(RegistrationManager.REGISTRATION_STATE_REGISTERING, mRegistrationCallbackHelper.getImsRegistrationState());
    verify(mMockRegistrationUpdate).handleImsRegistering(anyInt());
}
Also used : RegistrationCallback(android.telephony.ims.RegistrationManager.RegistrationCallback) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 2 with RegistrationCallback

use of android.telephony.ims.RegistrationManager.RegistrationCallback in project android_frameworks_opt_telephony by LineageOS.

the class ImsRegistrationCallbackHelperTest method testImsUnRegistered.

@Test
@SmallTest
public void testImsUnRegistered() {
    // Verify the RegistrationCallback should not be null
    RegistrationCallback callback = mRegistrationCallbackHelper.getCallback();
    assertNotNull(callback);
    // When onUnregistered is called, the registration state should be
    // REGISTRATION_STATE_NOT_REGISTERED
    ImsReasonInfo reasonInfo = new ImsReasonInfo(ImsReasonInfo.CODE_REGISTRATION_ERROR, 0);
    callback.onUnregistered(reasonInfo);
    // The registration state should be REGISTRATION_STATE_NOT_REGISTERED
    assertEquals(RegistrationManager.REGISTRATION_STATE_NOT_REGISTERED, mRegistrationCallbackHelper.getImsRegistrationState());
    verify(mMockRegistrationUpdate).handleImsUnregistered(reasonInfo);
}
Also used : RegistrationCallback(android.telephony.ims.RegistrationManager.RegistrationCallback) ImsReasonInfo(android.telephony.ims.ImsReasonInfo) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 3 with RegistrationCallback

use of android.telephony.ims.RegistrationManager.RegistrationCallback in project android_frameworks_opt_telephony by LineageOS.

the class ImsRegistrationCallbackHelperTest method testSubscriberAssociatedUriChanged.

@Test
@SmallTest
public void testSubscriberAssociatedUriChanged() {
    // Verify the RegistrationCallback should not be null
    RegistrationCallback callback = mRegistrationCallbackHelper.getCallback();
    assertNotNull(callback);
    // When onSubscriberAssociatedUriChanged is called
    Uri[] uris = new Uri[0];
    callback.onSubscriberAssociatedUriChanged(uris);
    // The handleImsSubscriberAssociatedUriChanged should be called
    verify(mMockRegistrationUpdate).handleImsSubscriberAssociatedUriChanged(uris);
}
Also used : RegistrationCallback(android.telephony.ims.RegistrationManager.RegistrationCallback) Uri(android.net.Uri) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 4 with RegistrationCallback

use of android.telephony.ims.RegistrationManager.RegistrationCallback in project android_frameworks_opt_telephony by LineageOS.

the class ImsRegistrationCallbackHelperTest method testImsOnRegistered.

@Test
@SmallTest
public void testImsOnRegistered() {
    // Verify the RegistrationCallback should not be null
    RegistrationCallback callback = mRegistrationCallbackHelper.getCallback();
    assertNotNull(callback);
    // When onRegistered is called, the registration state should be
    // REGISTRATION_STATE_REGISTERED
    callback.onRegistered(AccessNetworkType.IWLAN);
    assertEquals(RegistrationManager.REGISTRATION_STATE_REGISTERED, mRegistrationCallbackHelper.getImsRegistrationState());
    verify(mMockRegistrationUpdate).handleImsRegistered(anyInt());
}
Also used : RegistrationCallback(android.telephony.ims.RegistrationManager.RegistrationCallback) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

RegistrationCallback (android.telephony.ims.RegistrationManager.RegistrationCallback)4 SmallTest (android.test.suitebuilder.annotation.SmallTest)4 TelephonyTest (com.android.internal.telephony.TelephonyTest)4 Test (org.junit.Test)4 Uri (android.net.Uri)1 ImsReasonInfo (android.telephony.ims.ImsReasonInfo)1