Loading src/java/com/android/internal/telephony/IccCardProxy.java +22 −18 Original line number Diff line number Diff line Loading @@ -38,8 +38,8 @@ import com.android.internal.telephony.IccCardStatus.CardState; import com.android.internal.telephony.IccCardStatus.PinState; import com.android.internal.telephony.cdma.CdmaSubscriptionSourceManager; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.Phone; import static com.android.internal.telephony.Phone.CDMA_SUBSCRIPTION_NV; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_SIM_STATE; /** Loading Loading @@ -90,9 +90,6 @@ public class IccCardProxy extends Handler implements IccCard { private IccRecords mIccRecords = null; private CdmaSubscriptionSourceManager mCdmaSSM = null; private boolean mRadioOn = false; private boolean mCdmaSubscriptionFromNv = false; private boolean mIsMultimodeCdmaPhone = SystemProperties.getBoolean("ro.config.multimode_cdma", false); private boolean mQuietMode = false; // when set to true IccCardProxy will not broadcast // ACTION_SIM_STATE_CHANGED intents private boolean mInitialized = false; Loading Loading @@ -143,27 +140,29 @@ public class IccCardProxy extends Handler implements IccCard { /** * In case of 3gpp2 we need to find out if subscription used is coming from * NV in which case we shouldn't broadcast any sim states changes if at the * same time ro.config.multimode_cdma property set to false. * NV in which case we shouldn't broadcast any sim states changes. */ private void updateQuietMode() { synchronized (mLock) { if (DBG) log("Updating quiet mode"); boolean oldQuietMode = mQuietMode; boolean newQuietMode; int cdmaSource = Phone.CDMA_SUBSCRIPTION_UNKNOWN; boolean isLteOnCdmaMode = TelephonyManager.getLteOnCdmaModeStatic() == PhoneConstants.LTE_ON_CDMA_TRUE; if (mCurrentAppType == UiccController.APP_FAM_3GPP) { newQuietMode = false; if (DBG) log("3GPP subscription -> QuietMode: " + newQuietMode); if (DBG) log("updateQuietMode: 3GPP subscription -> newQuietMode=" + newQuietMode); } else { int newSubscriptionSource = mCdmaSSM.getCdmaSubscriptionSource(); mCdmaSubscriptionFromNv = newSubscriptionSource == CDMA_SUBSCRIPTION_NV; if (mCdmaSubscriptionFromNv && mIsMultimodeCdmaPhone) { log("Cdma multimode phone detected. Forcing IccCardProxy into 3gpp mode"); if (isLteOnCdmaMode) { log("updateQuietMode: is cdma/lte device, force IccCardProxy into 3gpp mode"); mCurrentAppType = UiccController.APP_FAM_3GPP; } newQuietMode = mCdmaSubscriptionFromNv cdmaSource = mCdmaSSM != null ? mCdmaSSM.getCdmaSubscriptionSource() : Phone.CDMA_SUBSCRIPTION_UNKNOWN; newQuietMode = (cdmaSource == Phone.CDMA_SUBSCRIPTION_NV) && (mCurrentAppType == UiccController.APP_FAM_3GPP2) && !mIsMultimodeCdmaPhone; && !isLteOnCdmaMode; } if (mQuietMode == false && newQuietMode == true) { Loading @@ -173,13 +172,18 @@ public class IccCardProxy extends Handler implements IccCard { setExternalState(State.READY); mQuietMode = newQuietMode; } else if (mQuietMode == true && newQuietMode == false) { if (DBG) log("Switching out from QuietMode. Force broadcast of current state:" + mExternalState); if (DBG) { log("updateQuietMode: Switching out from QuietMode." + " Force broadcast of current state=" + mExternalState); } mQuietMode = newQuietMode; setExternalState(mExternalState, true); } if (DBG) log("QuietMode is " + mQuietMode + " (app_type: " + mCurrentAppType + " nv: " + mCdmaSubscriptionFromNv + " multimode: " + mIsMultimodeCdmaPhone + ")"); if (DBG) { log("updateQuietMode: QuietMode is " + mQuietMode + " (app_type=" + mCurrentAppType + " isLteOnCdmaMode=" + isLteOnCdmaMode + " cdmaSource=" + cdmaSource + ")"); } mInitialized = true; sendMessage(obtainMessage(EVENT_ICC_CHANGED)); } Loading src/java/com/android/internal/telephony/Phone.java +1 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ public interface Phone { static final int CDMA_RM_ANY = 2; // Roaming on Any Network, as defined in PRL // Used for CDMA subscription mode static final int CDMA_SUBSCRIPTION_UNKNOWN =-1; // Unknown static final int CDMA_SUBSCRIPTION_RUIM_SIM = 0; // RUIM/SIM (default) static final int CDMA_SUBSCRIPTION_NV = 1; // NV -> non-volatile memory Loading src/java/com/android/internal/telephony/RIL.java +19 −0 Original line number Diff line number Diff line Loading @@ -2347,6 +2347,25 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } // Some devices do not send RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED so fake it. // See b/7255789 switch (rr.mRequest) { case RIL_REQUEST_ENTER_SIM_PIN: case RIL_REQUEST_ENTER_SIM_PUK: case RIL_REQUEST_ENTER_SIM_PIN2: case RIL_REQUEST_ENTER_SIM_PUK2: case RIL_REQUEST_CHANGE_SIM_PIN: case RIL_REQUEST_CHANGE_SIM_PIN2: if (RILJ_LOGD) { riljLog("fakeSimStatusChanged: reg count=" + mIccStatusChangedRegistrants.size()); } if (mIccStatusChangedRegistrants != null) { mIccStatusChangedRegistrants.notifyRegistrants(); } break; } if (error != 0) { rr.onError(error, ret); rr.release(); Loading Loading
src/java/com/android/internal/telephony/IccCardProxy.java +22 −18 Original line number Diff line number Diff line Loading @@ -38,8 +38,8 @@ import com.android.internal.telephony.IccCardStatus.CardState; import com.android.internal.telephony.IccCardStatus.PinState; import com.android.internal.telephony.cdma.CdmaSubscriptionSourceManager; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.Phone; import static com.android.internal.telephony.Phone.CDMA_SUBSCRIPTION_NV; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_SIM_STATE; /** Loading Loading @@ -90,9 +90,6 @@ public class IccCardProxy extends Handler implements IccCard { private IccRecords mIccRecords = null; private CdmaSubscriptionSourceManager mCdmaSSM = null; private boolean mRadioOn = false; private boolean mCdmaSubscriptionFromNv = false; private boolean mIsMultimodeCdmaPhone = SystemProperties.getBoolean("ro.config.multimode_cdma", false); private boolean mQuietMode = false; // when set to true IccCardProxy will not broadcast // ACTION_SIM_STATE_CHANGED intents private boolean mInitialized = false; Loading Loading @@ -143,27 +140,29 @@ public class IccCardProxy extends Handler implements IccCard { /** * In case of 3gpp2 we need to find out if subscription used is coming from * NV in which case we shouldn't broadcast any sim states changes if at the * same time ro.config.multimode_cdma property set to false. * NV in which case we shouldn't broadcast any sim states changes. */ private void updateQuietMode() { synchronized (mLock) { if (DBG) log("Updating quiet mode"); boolean oldQuietMode = mQuietMode; boolean newQuietMode; int cdmaSource = Phone.CDMA_SUBSCRIPTION_UNKNOWN; boolean isLteOnCdmaMode = TelephonyManager.getLteOnCdmaModeStatic() == PhoneConstants.LTE_ON_CDMA_TRUE; if (mCurrentAppType == UiccController.APP_FAM_3GPP) { newQuietMode = false; if (DBG) log("3GPP subscription -> QuietMode: " + newQuietMode); if (DBG) log("updateQuietMode: 3GPP subscription -> newQuietMode=" + newQuietMode); } else { int newSubscriptionSource = mCdmaSSM.getCdmaSubscriptionSource(); mCdmaSubscriptionFromNv = newSubscriptionSource == CDMA_SUBSCRIPTION_NV; if (mCdmaSubscriptionFromNv && mIsMultimodeCdmaPhone) { log("Cdma multimode phone detected. Forcing IccCardProxy into 3gpp mode"); if (isLteOnCdmaMode) { log("updateQuietMode: is cdma/lte device, force IccCardProxy into 3gpp mode"); mCurrentAppType = UiccController.APP_FAM_3GPP; } newQuietMode = mCdmaSubscriptionFromNv cdmaSource = mCdmaSSM != null ? mCdmaSSM.getCdmaSubscriptionSource() : Phone.CDMA_SUBSCRIPTION_UNKNOWN; newQuietMode = (cdmaSource == Phone.CDMA_SUBSCRIPTION_NV) && (mCurrentAppType == UiccController.APP_FAM_3GPP2) && !mIsMultimodeCdmaPhone; && !isLteOnCdmaMode; } if (mQuietMode == false && newQuietMode == true) { Loading @@ -173,13 +172,18 @@ public class IccCardProxy extends Handler implements IccCard { setExternalState(State.READY); mQuietMode = newQuietMode; } else if (mQuietMode == true && newQuietMode == false) { if (DBG) log("Switching out from QuietMode. Force broadcast of current state:" + mExternalState); if (DBG) { log("updateQuietMode: Switching out from QuietMode." + " Force broadcast of current state=" + mExternalState); } mQuietMode = newQuietMode; setExternalState(mExternalState, true); } if (DBG) log("QuietMode is " + mQuietMode + " (app_type: " + mCurrentAppType + " nv: " + mCdmaSubscriptionFromNv + " multimode: " + mIsMultimodeCdmaPhone + ")"); if (DBG) { log("updateQuietMode: QuietMode is " + mQuietMode + " (app_type=" + mCurrentAppType + " isLteOnCdmaMode=" + isLteOnCdmaMode + " cdmaSource=" + cdmaSource + ")"); } mInitialized = true; sendMessage(obtainMessage(EVENT_ICC_CHANGED)); } Loading
src/java/com/android/internal/telephony/Phone.java +1 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ public interface Phone { static final int CDMA_RM_ANY = 2; // Roaming on Any Network, as defined in PRL // Used for CDMA subscription mode static final int CDMA_SUBSCRIPTION_UNKNOWN =-1; // Unknown static final int CDMA_SUBSCRIPTION_RUIM_SIM = 0; // RUIM/SIM (default) static final int CDMA_SUBSCRIPTION_NV = 1; // NV -> non-volatile memory Loading
src/java/com/android/internal/telephony/RIL.java +19 −0 Original line number Diff line number Diff line Loading @@ -2347,6 +2347,25 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } // Some devices do not send RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED so fake it. // See b/7255789 switch (rr.mRequest) { case RIL_REQUEST_ENTER_SIM_PIN: case RIL_REQUEST_ENTER_SIM_PUK: case RIL_REQUEST_ENTER_SIM_PIN2: case RIL_REQUEST_ENTER_SIM_PUK2: case RIL_REQUEST_CHANGE_SIM_PIN: case RIL_REQUEST_CHANGE_SIM_PIN2: if (RILJ_LOGD) { riljLog("fakeSimStatusChanged: reg count=" + mIccStatusChangedRegistrants.size()); } if (mIccStatusChangedRegistrants != null) { mIccStatusChangedRegistrants.notifyRegistrants(); } break; } if (error != 0) { rr.onError(error, ret); rr.release(); Loading