use of com.android.internal.telephony.cdnr.CarrierDisplayNameResolver in project android_frameworks_opt_telephony by LineageOS.
the class CarrierDisplayNameResolverTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp("CDNRTest");
mCdnr = new CarrierDisplayNameResolver(mPhone);
UiccCardApplication uiccApp = Mockito.mock(UiccCardApplication.class);
doReturn(uiccApp).when(mPhone).getUiccCardApplication();
doReturn(AppState.APPSTATE_READY).when(uiccApp).getState();
doReturn(mSS).when(mSST).getServiceState();
doReturn(false).when(mPhone).isWifiCallingEnabled();
doReturn(true).when(mPhone).isPhoneTypeGsm();
mConfig = mContextFixture.getCarrierConfigBundle();
CarrierConfigManager mockConfigManager = Mockito.mock(CarrierConfigManager.class);
doReturn(mockConfigManager).when(mContext).getSystemService(Context.CARRIER_CONFIG_SERVICE);
doReturn(mConfig).when(mockConfigManager).getConfigForSubId(anyInt());
mSS.setEmergencyOnly(false);
mSS.setOperatorName("long name", "short name", HOME_PLMN_NUMERIC);
mSS.setVoiceRegState(ServiceState.STATE_IN_SERVICE);
mSS.setDataRegState(ServiceState.STATE_IN_SERVICE);
SIMRecords usim = Mockito.mock(SIMRecords.class);
doReturn(SPN_FROM_USIM).when(usim).getServiceProviderName();
doReturn(PNN_HOME_NAME_FROM_USIM).when(usim).getPnnHomeName();
doReturn(EHPLMNS_FROM_USIM).when(usim).getEhplmns();
doReturn(SPDI_FROM_USIM).when(usim).getServiceProviderDisplayInformation();
doReturn(SPN_DISPLAY_CONDITION_FROM_USIM).when(usim).getCarrierNameDisplayCondition();
mCdnr.updateEfFromUsim(usim);
}
Aggregations