Search in sources :

Example 11 with UiccCardApplication

use of com.android.internal.telephony.uicc.UiccCardApplication in project android_frameworks_opt_telephony by LineageOS.

the class GsmCdmaPhone method switchVoiceRadioTech.

private void switchVoiceRadioTech(int newVoiceRadioTech) {
    String outgoingPhoneName = getPhoneName();
    logd("Switching Voice Phone : " + outgoingPhoneName + " >>> " + (ServiceState.isGsm(newVoiceRadioTech) ? "GSM" : "CDMA"));
    if (ServiceState.isCdma(newVoiceRadioTech)) {
        UiccCardApplication cdmaApplication = mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP2);
        if (cdmaApplication != null && cdmaApplication.getType() == AppType.APPTYPE_RUIM) {
            switchPhoneType(PhoneConstants.PHONE_TYPE_CDMA);
        } else {
            switchPhoneType(PhoneConstants.PHONE_TYPE_CDMA_LTE);
        }
    } else if (ServiceState.isGsm(newVoiceRadioTech)) {
        switchPhoneType(PhoneConstants.PHONE_TYPE_GSM);
    } else {
        loge("deleteAndCreatePhone: newVoiceRadioTech=" + newVoiceRadioTech + " is not CDMA or GSM (error) - aborting!");
        return;
    }
}
Also used : UiccCardApplication(com.android.internal.telephony.uicc.UiccCardApplication)

Example 12 with UiccCardApplication

use of com.android.internal.telephony.uicc.UiccCardApplication in project android_frameworks_opt_telephony by LineageOS.

the class Phone method getIccFileHandler.

/**
 * Retrieves the IccFileHandler of the Phone instance
 */
@UnsupportedAppUsage
public IccFileHandler getIccFileHandler() {
    UiccCardApplication uiccApplication = mUiccApplication.get();
    IccFileHandler fh;
    if (uiccApplication == null) {
        Rlog.d(LOG_TAG, "getIccFileHandler: uiccApplication == null, return null");
        fh = null;
    } else {
        fh = uiccApplication.getIccFileHandler();
    }
    Rlog.d(LOG_TAG, "getIccFileHandler: fh=" + fh);
    return fh;
}
Also used : IccFileHandler(com.android.internal.telephony.uicc.IccFileHandler) UiccCardApplication(com.android.internal.telephony.uicc.UiccCardApplication) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 13 with UiccCardApplication

use of com.android.internal.telephony.uicc.UiccCardApplication 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);
}
Also used : CarrierConfigManager(android.telephony.CarrierConfigManager) CarrierDisplayNameResolver(com.android.internal.telephony.cdnr.CarrierDisplayNameResolver) SIMRecords(com.android.internal.telephony.uicc.SIMRecords) UiccCardApplication(com.android.internal.telephony.uicc.UiccCardApplication) Before(org.junit.Before)

Example 14 with UiccCardApplication

use of com.android.internal.telephony.uicc.UiccCardApplication in project android_frameworks_opt_telephony by LineageOS.

the class ServiceStateTracker method onUpdateIccAvailability.

protected void onUpdateIccAvailability() {
    if (mUiccController == null) {
        return;
    }
    UiccCardApplication newUiccApplication = getUiccCardApplication();
    if (mUiccApplcation != newUiccApplication) {
        // Remove the EF records that come from UICC
        if (mIccRecords instanceof SIMRecords) {
            mCdnr.updateEfFromUsim(null);
        } else if (mIccRecords instanceof RuimRecords) {
            mCdnr.updateEfFromRuim(null);
        }
        if (mUiccApplcation != null) {
            log("Removing stale icc objects.");
            mUiccApplcation.unregisterForReady(this);
            if (mIccRecords != null) {
                mIccRecords.unregisterForRecordsLoaded(this);
            }
            mIccRecords = null;
            mUiccApplcation = null;
        }
        if (newUiccApplication != null) {
            log("New card found");
            mUiccApplcation = newUiccApplication;
            mIccRecords = mUiccApplcation.getIccRecords();
            if (mPhone.isPhoneTypeGsm()) {
                mUiccApplcation.registerForReady(this, EVENT_SIM_READY, null);
                if (mIccRecords != null) {
                    mIccRecords.registerForRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null);
                }
            } else if (mIsSubscriptionFromRuim) {
                mUiccApplcation.registerForReady(this, EVENT_RUIM_READY, null);
                if (mIccRecords != null) {
                    mIccRecords.registerForRecordsLoaded(this, EVENT_RUIM_RECORDS_LOADED, null);
                }
            }
        }
    }
}
Also used : SIMRecords(com.android.internal.telephony.uicc.SIMRecords) RuimRecords(com.android.internal.telephony.uicc.RuimRecords) UiccCardApplication(com.android.internal.telephony.uicc.UiccCardApplication)

Aggregations

UiccCardApplication (com.android.internal.telephony.uicc.UiccCardApplication)14 IccRecords (com.android.internal.telephony.uicc.IccRecords)6 IccFileHandler (com.android.internal.telephony.uicc.IccFileHandler)3 SIMRecords (com.android.internal.telephony.uicc.SIMRecords)3 UnsupportedAppUsage (android.compat.annotation.UnsupportedAppUsage)2 RuimRecords (com.android.internal.telephony.uicc.RuimRecords)2 NonNull (android.annotation.NonNull)1 CarrierConfigManager (android.telephony.CarrierConfigManager)1 CarrierDisplayNameResolver (com.android.internal.telephony.cdnr.CarrierDisplayNameResolver)1 AppState (com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState)1 IsimUiccRecords (com.android.internal.telephony.uicc.IsimUiccRecords)1 UiccCard (com.android.internal.telephony.uicc.UiccCard)1 Before (org.junit.Before)1