Loading telephony/java/com/android/internal/telephony/IccCard.java +59 −34 Original line number Diff line number Diff line Loading @@ -722,22 +722,37 @@ public abstract class IccCard { currentRadioState == RadioState.RUIM_READY || (currentRadioState == RadioState.NV_READY && (mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE))) { int index; State csimState = getAppState(mIccCardStatus.getCdmaSubscriptionAppIndex()); State usimState = getAppState(mIccCardStatus.getGsmUmtsSubscriptionAppIndex()); if(mDbg) log("USIM=" + usimState + " CSIM=" + csimState); if (mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE) { // UICC card contains both USIM and CSIM // Return consolidated status return getConsolidatedState(csimState, usimState, csimState); } // check for CDMA radio technology if (currentRadioState == RadioState.RUIM_LOCKED_OR_ABSENT || currentRadioState == RadioState.RUIM_READY) { index = mIccCardStatus.getCdmaSubscriptionAppIndex(); return csimState; } else { index = mIccCardStatus.getGsmUmtsSubscriptionAppIndex(); return usimState; } return IccCard.State.ABSENT; } private State getAppState(int appIndex) { IccCardApplication app; if (index >= 0 && index < IccCardStatus.CARD_MAX_APPS) { app = mIccCardStatus.getApplication(index); if (appIndex >= 0 && appIndex < IccCardStatus.CARD_MAX_APPS) { app = mIccCardStatus.getApplication(appIndex); } else { Log.e(mLogTag, "[IccCard] Invalid Subscription Application index:" + index); Log.e(mLogTag, "[IccCard] Invalid Subscription Application index:" + appIndex); return IccCard.State.ABSENT; } Loading Loading @@ -765,9 +780,19 @@ public abstract class IccCard { return IccCard.State.NOT_READY; } return IccCard.State.ABSENT; } private State getConsolidatedState(State left, State right, State preferredState) { // Check if either is absent. if (right == IccCard.State.ABSENT) return left; if (left == IccCard.State.ABSENT) return right; // Disregards if either is NOT_READY if (right == IccCard.State.NOT_READY) return left; if (left == IccCard.State.NOT_READY) return right; // At this point, FW currently just assumes the status will be // consistent across the applications... return preferredState; } public boolean isApplicationOnIcc(IccCardApplication.AppType type) { if (mIccCardStatus == null) return false; Loading Loading
telephony/java/com/android/internal/telephony/IccCard.java +59 −34 Original line number Diff line number Diff line Loading @@ -722,22 +722,37 @@ public abstract class IccCard { currentRadioState == RadioState.RUIM_READY || (currentRadioState == RadioState.NV_READY && (mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE))) { int index; State csimState = getAppState(mIccCardStatus.getCdmaSubscriptionAppIndex()); State usimState = getAppState(mIccCardStatus.getGsmUmtsSubscriptionAppIndex()); if(mDbg) log("USIM=" + usimState + " CSIM=" + csimState); if (mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE) { // UICC card contains both USIM and CSIM // Return consolidated status return getConsolidatedState(csimState, usimState, csimState); } // check for CDMA radio technology if (currentRadioState == RadioState.RUIM_LOCKED_OR_ABSENT || currentRadioState == RadioState.RUIM_READY) { index = mIccCardStatus.getCdmaSubscriptionAppIndex(); return csimState; } else { index = mIccCardStatus.getGsmUmtsSubscriptionAppIndex(); return usimState; } return IccCard.State.ABSENT; } private State getAppState(int appIndex) { IccCardApplication app; if (index >= 0 && index < IccCardStatus.CARD_MAX_APPS) { app = mIccCardStatus.getApplication(index); if (appIndex >= 0 && appIndex < IccCardStatus.CARD_MAX_APPS) { app = mIccCardStatus.getApplication(appIndex); } else { Log.e(mLogTag, "[IccCard] Invalid Subscription Application index:" + index); Log.e(mLogTag, "[IccCard] Invalid Subscription Application index:" + appIndex); return IccCard.State.ABSENT; } Loading Loading @@ -765,9 +780,19 @@ public abstract class IccCard { return IccCard.State.NOT_READY; } return IccCard.State.ABSENT; } private State getConsolidatedState(State left, State right, State preferredState) { // Check if either is absent. if (right == IccCard.State.ABSENT) return left; if (left == IccCard.State.ABSENT) return right; // Disregards if either is NOT_READY if (right == IccCard.State.NOT_READY) return left; if (left == IccCard.State.NOT_READY) return right; // At this point, FW currently just assumes the status will be // consistent across the applications... return preferredState; } public boolean isApplicationOnIcc(IccCardApplication.AppType type) { if (mIccCardStatus == null) return false; Loading