Loading src/java/com/android/internal/telephony/uicc/UiccController.java +24 −3 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import android.telephony.Rlog; import android.telephony.TelephonyManager; import android.util.LocalLog; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.CommandException; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.IccCardConstants; Loading Loading @@ -471,10 +470,32 @@ public class UiccController extends Handler { } } static void updateInternalIccState(String value, String reason, int phoneId) { static String getIccStateIntentString(IccCardConstants.State state) { switch (state) { case ABSENT: return IccCardConstants.INTENT_VALUE_ICC_ABSENT; case PIN_REQUIRED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case PUK_REQUIRED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case NETWORK_LOCKED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case READY: return IccCardConstants.INTENT_VALUE_ICC_READY; case NOT_READY: return IccCardConstants.INTENT_VALUE_ICC_NOT_READY; case PERM_DISABLED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case CARD_IO_ERROR: return IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR; case CARD_RESTRICTED: return IccCardConstants.INTENT_VALUE_ICC_CARD_RESTRICTED; case LOADED: return IccCardConstants.INTENT_VALUE_ICC_LOADED; default: return IccCardConstants.INTENT_VALUE_ICC_UNKNOWN; } } static void updateInternalIccState(Context context, IccCardConstants.State state, String reason, int phoneId) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService( Context.TELEPHONY_SERVICE); telephonyManager.setSimStateForPhone(phoneId, state.toString()); SubscriptionInfoUpdater subInfoUpdator = PhoneFactory.getSubscriptionInfoUpdater(); if (subInfoUpdator != null) { subInfoUpdator.updateInternalIccState(value, reason, phoneId); subInfoUpdator.updateInternalIccState(getIccStateIntentString(state), reason, phoneId); } else { Rlog.e(LOG_TAG, "subInfoUpdate is null."); } Loading src/java/com/android/internal/telephony/uicc/UiccProfile.java +1 −18 Original line number Diff line number Diff line Loading @@ -603,9 +603,8 @@ public class UiccProfile extends IccCard { } } log("setExternalState: set mPhoneId=" + mPhoneId + " mExternalState=" + mExternalState); mTelephonyManager.setSimStateForPhone(mPhoneId, getState().toString()); UiccController.updateInternalIccState(getIccStateIntentString(mExternalState), UiccController.updateInternalIccState(mContext, mExternalState, getIccStateReason(mExternalState), mPhoneId); } } Loading @@ -627,22 +626,6 @@ public class UiccProfile extends IccCard { } } private String getIccStateIntentString(IccCardConstants.State state) { switch (state) { case ABSENT: return IccCardConstants.INTENT_VALUE_ICC_ABSENT; case PIN_REQUIRED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case PUK_REQUIRED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case NETWORK_LOCKED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case READY: return IccCardConstants.INTENT_VALUE_ICC_READY; case NOT_READY: return IccCardConstants.INTENT_VALUE_ICC_NOT_READY; case PERM_DISABLED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case CARD_IO_ERROR: return IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR; case CARD_RESTRICTED: return IccCardConstants.INTENT_VALUE_ICC_CARD_RESTRICTED; case LOADED: return IccCardConstants.INTENT_VALUE_ICC_LOADED; default: return IccCardConstants.INTENT_VALUE_ICC_UNKNOWN; } } /** * Locked state have a reason (PIN, PUK, NETWORK, PERM_DISABLED, CARD_IO_ERROR) * @return reason Loading src/java/com/android/internal/telephony/uicc/UiccSlot.java +2 −2 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ public class UiccSlot extends Handler { } UiccController.updateInternalIccState( IccCardConstants.INTENT_VALUE_ICC_ABSENT, null, mPhoneId); mContext, IccCardConstants.State.ABSENT, null, mPhoneId); // no card present in the slot now; dispose card and make mUiccCard null if (mUiccCard != null) { Loading Loading @@ -362,7 +362,7 @@ public class UiccSlot extends Handler { if (mPhoneId != INVALID_PHONE_ID) { UiccController.updateInternalIccState( IccCardConstants.INTENT_VALUE_ICC_UNKNOWN, null, mPhoneId); mContext, IccCardConstants.State.UNKNOWN, null, mPhoneId); } mCardState = CardState.CARDSTATE_ABSENT; Loading Loading
src/java/com/android/internal/telephony/uicc/UiccController.java +24 −3 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import android.telephony.Rlog; import android.telephony.TelephonyManager; import android.util.LocalLog; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.CommandException; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.IccCardConstants; Loading Loading @@ -471,10 +470,32 @@ public class UiccController extends Handler { } } static void updateInternalIccState(String value, String reason, int phoneId) { static String getIccStateIntentString(IccCardConstants.State state) { switch (state) { case ABSENT: return IccCardConstants.INTENT_VALUE_ICC_ABSENT; case PIN_REQUIRED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case PUK_REQUIRED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case NETWORK_LOCKED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case READY: return IccCardConstants.INTENT_VALUE_ICC_READY; case NOT_READY: return IccCardConstants.INTENT_VALUE_ICC_NOT_READY; case PERM_DISABLED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case CARD_IO_ERROR: return IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR; case CARD_RESTRICTED: return IccCardConstants.INTENT_VALUE_ICC_CARD_RESTRICTED; case LOADED: return IccCardConstants.INTENT_VALUE_ICC_LOADED; default: return IccCardConstants.INTENT_VALUE_ICC_UNKNOWN; } } static void updateInternalIccState(Context context, IccCardConstants.State state, String reason, int phoneId) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService( Context.TELEPHONY_SERVICE); telephonyManager.setSimStateForPhone(phoneId, state.toString()); SubscriptionInfoUpdater subInfoUpdator = PhoneFactory.getSubscriptionInfoUpdater(); if (subInfoUpdator != null) { subInfoUpdator.updateInternalIccState(value, reason, phoneId); subInfoUpdator.updateInternalIccState(getIccStateIntentString(state), reason, phoneId); } else { Rlog.e(LOG_TAG, "subInfoUpdate is null."); } Loading
src/java/com/android/internal/telephony/uicc/UiccProfile.java +1 −18 Original line number Diff line number Diff line Loading @@ -603,9 +603,8 @@ public class UiccProfile extends IccCard { } } log("setExternalState: set mPhoneId=" + mPhoneId + " mExternalState=" + mExternalState); mTelephonyManager.setSimStateForPhone(mPhoneId, getState().toString()); UiccController.updateInternalIccState(getIccStateIntentString(mExternalState), UiccController.updateInternalIccState(mContext, mExternalState, getIccStateReason(mExternalState), mPhoneId); } } Loading @@ -627,22 +626,6 @@ public class UiccProfile extends IccCard { } } private String getIccStateIntentString(IccCardConstants.State state) { switch (state) { case ABSENT: return IccCardConstants.INTENT_VALUE_ICC_ABSENT; case PIN_REQUIRED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case PUK_REQUIRED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case NETWORK_LOCKED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case READY: return IccCardConstants.INTENT_VALUE_ICC_READY; case NOT_READY: return IccCardConstants.INTENT_VALUE_ICC_NOT_READY; case PERM_DISABLED: return IccCardConstants.INTENT_VALUE_ICC_LOCKED; case CARD_IO_ERROR: return IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR; case CARD_RESTRICTED: return IccCardConstants.INTENT_VALUE_ICC_CARD_RESTRICTED; case LOADED: return IccCardConstants.INTENT_VALUE_ICC_LOADED; default: return IccCardConstants.INTENT_VALUE_ICC_UNKNOWN; } } /** * Locked state have a reason (PIN, PUK, NETWORK, PERM_DISABLED, CARD_IO_ERROR) * @return reason Loading
src/java/com/android/internal/telephony/uicc/UiccSlot.java +2 −2 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ public class UiccSlot extends Handler { } UiccController.updateInternalIccState( IccCardConstants.INTENT_VALUE_ICC_ABSENT, null, mPhoneId); mContext, IccCardConstants.State.ABSENT, null, mPhoneId); // no card present in the slot now; dispose card and make mUiccCard null if (mUiccCard != null) { Loading Loading @@ -362,7 +362,7 @@ public class UiccSlot extends Handler { if (mPhoneId != INVALID_PHONE_ID) { UiccController.updateInternalIccState( IccCardConstants.INTENT_VALUE_ICC_UNKNOWN, null, mPhoneId); mContext, IccCardConstants.State.UNKNOWN, null, mPhoneId); } mCardState = CardState.CARDSTATE_ABSENT; Loading