use of android.telephony.ims.ImsException in project robolectric by robolectric.
the class ShadowImsMmTelManagerTest method registerMmTelCapabilityCallback_imsNotSupported_imsExceptionThrown.
@Test
public void registerMmTelCapabilityCallback_imsNotSupported_imsExceptionThrown() {
shadowImsMmTelManager.setImsAvailableOnDevice(false);
try {
shadowImsMmTelManager.registerMmTelCapabilityCallback(Runnable::run, new CapabilityCallback());
assertWithMessage("Expected ImsException was not thrown").fail();
} catch (ImsException e) {
assertThat(e.getCode()).isEqualTo(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION);
assertThat(e).hasMessageThat().contains("IMS not available on device.");
}
}
use of android.telephony.ims.ImsException in project android_packages_apps_Settings by omnirom.
the class SimStatusDialogController method registerImsRegistrationCallback.
private void registerImsRegistrationCallback(int subId) {
if (!isImsRegistrationStateShowUp()) {
return;
}
try {
final ImsMmTelManager imsMmTelMgr = ImsMmTelManager.createForSubscriptionId(subId);
imsMmTelMgr.registerImsRegistrationCallback(mDialog.getContext().getMainExecutor(), mImsRegStateCallback);
} catch (ImsException exception) {
Log.w(TAG, "fail to register IMS status for subId=" + subId, exception);
}
}
Aggregations