Loading src/java/com/android/internal/telephony/uicc/SIMRecords.java +522 −520 Original line number Diff line number Diff line Loading @@ -664,7 +664,8 @@ public class SIMRecords extends IccRecords { return; } try { switch (msg.what) { try { switch (msg.what) { case EVENT_APP_READY: onReady(); break; Loading Loading @@ -696,8 +697,8 @@ public class SIMRecords extends IccRecords { log("IMSI: mMncLength=" + mMncLength); log("IMSI: " + mImsi.substring(0, 6) + Rlog.pii(LOG_TAG, mImsi.substring(6))); if (((mMncLength == UNKNOWN) || (mMncLength == 2)) && ((mImsi != null) && (mImsi.length() >= 6))) { if (((mMncLength == UNKNOWN) || (mMncLength == 2)) && ((mImsi != null) && (mImsi.length() >= 6))) { String mccmncCode = mImsi.substring(0, 6); for (String mccmnc : MCCMNC_CODES_HAVING_3DIGITS_MNC) { if (mccmnc.equals(mccmncCode)) { Loading @@ -723,7 +724,8 @@ public class SIMRecords extends IccRecords { if (mMncLength != UNKNOWN && mMncLength != UNINITIALIZED) { log("update mccmnc=" + mImsi.substring(0, 3 + mMncLength)); // finally have both the imsi and the mncLength and can parse the imsi properly // finally have both the imsi and the mncLength and // can parse the imsi properly MccTable.updateMccMncConfiguration(mContext, mImsi.substring(0, 3 + mMncLength), false); } Loading Loading @@ -784,7 +786,8 @@ public class SIMRecords extends IccRecords { if (ar.exception != null) { log("Invalid or missing EF" + ((msg.what == EVENT_GET_CPHS_MAILBOX_DONE) ? "[MAILBOX]" : "[MBDN]")); + ((msg.what == EVENT_GET_CPHS_MAILBOX_DONE) ? "[MAILBOX]" : "[MBDN]")); // Bug #645770 fall back to CPHS // FIXME should use SST to decide Loading @@ -803,8 +806,9 @@ public class SIMRecords extends IccRecords { adn = (AdnRecord) ar.result; log("VM: " + adn + ((msg.what == EVENT_GET_CPHS_MAILBOX_DONE) ? " EF[MAILBOX]" : " EF[MBDN]")); log("VM: " + adn + ((msg.what == EVENT_GET_CPHS_MAILBOX_DONE) ? " EF[MAILBOX]" : " EF[MBDN]")); if (adn.isEmpty() && msg.what == EVENT_GET_MBDN_DONE) { // Bug #645770 fall back to CPHS Loading Loading @@ -851,8 +855,7 @@ public class SIMRecords extends IccRecords { } if (ar.userObj != null) { AsyncResult.forMessage(((Message) ar.userObj)).exception = ar.exception; AsyncResult.forMessage(((Message) ar.userObj)).exception = ar.exception; ((Message) ar.userObj).sendToTarget(); } break; Loading @@ -866,8 +869,7 @@ public class SIMRecords extends IccRecords { if (DBG) log("EF_MWIS : " + IccUtils.bytesToHexString(data)); if (ar.exception != null) { if(DBG) log("EVENT_GET_MWIS_DONE exception = " + ar.exception); if (DBG) log("EVENT_GET_MWIS_DONE exception = " + ar.exception); break; } Loading @@ -888,8 +890,10 @@ public class SIMRecords extends IccRecords { if (DBG) log("EF_CPHS_MWI: " + IccUtils.bytesToHexString(data)); if (ar.exception != null) { if(DBG) log("EVENT_GET_VOICE_MAIL_INDICATOR_CPHS_DONE exception = " if (DBG) { log("EVENT_GET_VOICE_MAIL_INDICATOR_CPHS_DONE exception = " + ar.exception); } break; } Loading @@ -910,7 +914,6 @@ public class SIMRecords extends IccRecords { mFullIccId = IccUtils.bchToString(data, 0, data.length); log("iccid: " + SubscriptionInfo.givePrintableIccid(mFullIccId)); break; Loading Loading @@ -948,8 +951,9 @@ public class SIMRecords extends IccRecords { log("setting5 mMncLength=" + mMncLength); } } finally { if (((mMncLength == UNINITIALIZED) || (mMncLength == UNKNOWN) || (mMncLength == 2)) && ((mImsi != null) && (mImsi.length() >= 6))) { if (((mMncLength == UNINITIALIZED) || (mMncLength == UNKNOWN) || (mMncLength == 2)) && ((mImsi != null) && (mImsi.length() >= 6))) { String mccmncCode = mImsi.substring(0, 6); log("mccmncCode=" + mccmncCode); for (String mccmnc : MCCMNC_CODES_HAVING_3DIGITS_MNC) { Loading @@ -975,7 +979,8 @@ public class SIMRecords extends IccRecords { } else { // Indicate we got this info, but it didn't contain the length. mMncLength = UNKNOWN; log("MNC length not present in EF_AD setting9 mMncLength=" + mMncLength); log("MNC length not present in EF_AD setting9 " + "mMncLength=" + mMncLength); } } if (mImsi != null && mMncLength != UNKNOWN) { Loading Loading @@ -1043,8 +1048,7 @@ public class SIMRecords extends IccRecords { for (; tlv.isValidObject(); tlv.nextObject()) { if (tlv.getTag() == TAG_FULL_NETWORK_NAME) { mPnnHomeName = IccUtils.networkNameToString( mPnnHomeName = IccUtils.networkNameToString( tlv.getData(), 0, tlv.getData().length); break; } Loading @@ -1055,8 +1059,9 @@ public class SIMRecords extends IccRecords { isRecordLoadResponse = true; ar = (AsyncResult) msg.obj; if (ar.exception != null) if (ar.exception != null) { break; } handleSmses((ArrayList<byte []>) ar.result); break; Loading Loading @@ -1141,8 +1146,7 @@ public class SIMRecords extends IccRecords { * onCphsCompleted to null */ if (ar.exception == null && ar.userObj != null) { AsyncResult.forMessage(((Message) ar.userObj)).exception = null; AsyncResult.forMessage(((Message) ar.userObj)).exception = null; ((Message) ar.userObj).sendToTarget(); if (DBG) log("Callback with MBDN successful."); Loading @@ -1150,25 +1154,25 @@ public class SIMRecords extends IccRecords { onCphsCompleted = null; } new AdnRecordLoader(mFh). updateEF(adn, EF_MAILBOX_CPHS, EF_EXT1, 1, null, new AdnRecordLoader(mFh) .updateEF(adn, EF_MAILBOX_CPHS, EF_EXT1, 1, null, obtainMessage(EVENT_SET_CPHS_MAILBOX_DONE, onCphsCompleted)); } else { if (ar.userObj != null) { CarrierConfigManager configLoader = (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE); if (ar.exception != null && configLoader != null && configLoader.getConfig().getBoolean( if (ar.exception != null && configLoader != null && configLoader.getConfig().getBoolean( CarrierConfigManager.KEY_EDITABLE_VOICEMAIL_NUMBER_BOOL)) { // GsmCdmaPhone will store vm number on device // when IccVmNotSupportedException occurred AsyncResult.forMessage(((Message) ar.userObj)).exception = new IccVmNotSupportedException( AsyncResult.forMessage(((Message) ar.userObj)).exception = new IccVmNotSupportedException( "Update SIM voice mailbox error"); } else { AsyncResult.forMessage(((Message) ar.userObj)).exception = ar.exception; AsyncResult.forMessage(((Message) ar.userObj)) .exception = ar.exception; } ((Message) ar.userObj).sendToTarget(); } Loading @@ -1181,8 +1185,7 @@ public class SIMRecords extends IccRecords { mVoiceMailNum = mNewVoiceMailNum; mVoiceMailTag = mNewVoiceMailTag; } else { if (DBG) log("Set CPHS MailBox with exception: " + ar.exception); if (DBG) log("Set CPHS MailBox with exception: " + ar.exception); } if (ar.userObj != null) { if (DBG) log("Callback with CPHS MB successful."); Loading Loading @@ -1248,7 +1251,6 @@ public class SIMRecords extends IccRecords { case EVENT_GET_GID2_DONE: isRecordLoadResponse = true; ar = (AsyncResult) msg.obj; data = (byte[]) ar.result; Loading Loading @@ -1334,8 +1336,8 @@ public class SIMRecords extends IccRecords { default: super.handleMessage(msg); // IccRecords handles generic record load responses }}catch (RuntimeException exc) { } } catch (RuntimeException exc) { // I don't want these exceptions to be fatal logw("Exception parsing SIM record", exc); } finally { Loading Loading @@ -1845,10 +1847,10 @@ public class SIMRecords extends IccRecords { if (start) { // Check previous state to see if there is outstanding // SPN read if(mSpnState == GetSpnFsmState.READ_SPN_3GPP || mSpnState == GetSpnFsmState.READ_SPN_CPHS || mSpnState == GetSpnFsmState.READ_SPN_SHORT_CPHS || mSpnState == GetSpnFsmState.INIT) { if (mSpnState == GetSpnFsmState.READ_SPN_3GPP || mSpnState == GetSpnFsmState.READ_SPN_CPHS || mSpnState == GetSpnFsmState.READ_SPN_SHORT_CPHS || mSpnState == GetSpnFsmState.INIT) { // Set INIT then return so the INIT code // will run when the outstanding read done. mSpnState = GetSpnFsmState.INIT; Loading Loading
src/java/com/android/internal/telephony/uicc/SIMRecords.java +522 −520 Original line number Diff line number Diff line Loading @@ -664,7 +664,8 @@ public class SIMRecords extends IccRecords { return; } try { switch (msg.what) { try { switch (msg.what) { case EVENT_APP_READY: onReady(); break; Loading Loading @@ -696,8 +697,8 @@ public class SIMRecords extends IccRecords { log("IMSI: mMncLength=" + mMncLength); log("IMSI: " + mImsi.substring(0, 6) + Rlog.pii(LOG_TAG, mImsi.substring(6))); if (((mMncLength == UNKNOWN) || (mMncLength == 2)) && ((mImsi != null) && (mImsi.length() >= 6))) { if (((mMncLength == UNKNOWN) || (mMncLength == 2)) && ((mImsi != null) && (mImsi.length() >= 6))) { String mccmncCode = mImsi.substring(0, 6); for (String mccmnc : MCCMNC_CODES_HAVING_3DIGITS_MNC) { if (mccmnc.equals(mccmncCode)) { Loading @@ -723,7 +724,8 @@ public class SIMRecords extends IccRecords { if (mMncLength != UNKNOWN && mMncLength != UNINITIALIZED) { log("update mccmnc=" + mImsi.substring(0, 3 + mMncLength)); // finally have both the imsi and the mncLength and can parse the imsi properly // finally have both the imsi and the mncLength and // can parse the imsi properly MccTable.updateMccMncConfiguration(mContext, mImsi.substring(0, 3 + mMncLength), false); } Loading Loading @@ -784,7 +786,8 @@ public class SIMRecords extends IccRecords { if (ar.exception != null) { log("Invalid or missing EF" + ((msg.what == EVENT_GET_CPHS_MAILBOX_DONE) ? "[MAILBOX]" : "[MBDN]")); + ((msg.what == EVENT_GET_CPHS_MAILBOX_DONE) ? "[MAILBOX]" : "[MBDN]")); // Bug #645770 fall back to CPHS // FIXME should use SST to decide Loading @@ -803,8 +806,9 @@ public class SIMRecords extends IccRecords { adn = (AdnRecord) ar.result; log("VM: " + adn + ((msg.what == EVENT_GET_CPHS_MAILBOX_DONE) ? " EF[MAILBOX]" : " EF[MBDN]")); log("VM: " + adn + ((msg.what == EVENT_GET_CPHS_MAILBOX_DONE) ? " EF[MAILBOX]" : " EF[MBDN]")); if (adn.isEmpty() && msg.what == EVENT_GET_MBDN_DONE) { // Bug #645770 fall back to CPHS Loading Loading @@ -851,8 +855,7 @@ public class SIMRecords extends IccRecords { } if (ar.userObj != null) { AsyncResult.forMessage(((Message) ar.userObj)).exception = ar.exception; AsyncResult.forMessage(((Message) ar.userObj)).exception = ar.exception; ((Message) ar.userObj).sendToTarget(); } break; Loading @@ -866,8 +869,7 @@ public class SIMRecords extends IccRecords { if (DBG) log("EF_MWIS : " + IccUtils.bytesToHexString(data)); if (ar.exception != null) { if(DBG) log("EVENT_GET_MWIS_DONE exception = " + ar.exception); if (DBG) log("EVENT_GET_MWIS_DONE exception = " + ar.exception); break; } Loading @@ -888,8 +890,10 @@ public class SIMRecords extends IccRecords { if (DBG) log("EF_CPHS_MWI: " + IccUtils.bytesToHexString(data)); if (ar.exception != null) { if(DBG) log("EVENT_GET_VOICE_MAIL_INDICATOR_CPHS_DONE exception = " if (DBG) { log("EVENT_GET_VOICE_MAIL_INDICATOR_CPHS_DONE exception = " + ar.exception); } break; } Loading @@ -910,7 +914,6 @@ public class SIMRecords extends IccRecords { mFullIccId = IccUtils.bchToString(data, 0, data.length); log("iccid: " + SubscriptionInfo.givePrintableIccid(mFullIccId)); break; Loading Loading @@ -948,8 +951,9 @@ public class SIMRecords extends IccRecords { log("setting5 mMncLength=" + mMncLength); } } finally { if (((mMncLength == UNINITIALIZED) || (mMncLength == UNKNOWN) || (mMncLength == 2)) && ((mImsi != null) && (mImsi.length() >= 6))) { if (((mMncLength == UNINITIALIZED) || (mMncLength == UNKNOWN) || (mMncLength == 2)) && ((mImsi != null) && (mImsi.length() >= 6))) { String mccmncCode = mImsi.substring(0, 6); log("mccmncCode=" + mccmncCode); for (String mccmnc : MCCMNC_CODES_HAVING_3DIGITS_MNC) { Loading @@ -975,7 +979,8 @@ public class SIMRecords extends IccRecords { } else { // Indicate we got this info, but it didn't contain the length. mMncLength = UNKNOWN; log("MNC length not present in EF_AD setting9 mMncLength=" + mMncLength); log("MNC length not present in EF_AD setting9 " + "mMncLength=" + mMncLength); } } if (mImsi != null && mMncLength != UNKNOWN) { Loading Loading @@ -1043,8 +1048,7 @@ public class SIMRecords extends IccRecords { for (; tlv.isValidObject(); tlv.nextObject()) { if (tlv.getTag() == TAG_FULL_NETWORK_NAME) { mPnnHomeName = IccUtils.networkNameToString( mPnnHomeName = IccUtils.networkNameToString( tlv.getData(), 0, tlv.getData().length); break; } Loading @@ -1055,8 +1059,9 @@ public class SIMRecords extends IccRecords { isRecordLoadResponse = true; ar = (AsyncResult) msg.obj; if (ar.exception != null) if (ar.exception != null) { break; } handleSmses((ArrayList<byte []>) ar.result); break; Loading Loading @@ -1141,8 +1146,7 @@ public class SIMRecords extends IccRecords { * onCphsCompleted to null */ if (ar.exception == null && ar.userObj != null) { AsyncResult.forMessage(((Message) ar.userObj)).exception = null; AsyncResult.forMessage(((Message) ar.userObj)).exception = null; ((Message) ar.userObj).sendToTarget(); if (DBG) log("Callback with MBDN successful."); Loading @@ -1150,25 +1154,25 @@ public class SIMRecords extends IccRecords { onCphsCompleted = null; } new AdnRecordLoader(mFh). updateEF(adn, EF_MAILBOX_CPHS, EF_EXT1, 1, null, new AdnRecordLoader(mFh) .updateEF(adn, EF_MAILBOX_CPHS, EF_EXT1, 1, null, obtainMessage(EVENT_SET_CPHS_MAILBOX_DONE, onCphsCompleted)); } else { if (ar.userObj != null) { CarrierConfigManager configLoader = (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE); if (ar.exception != null && configLoader != null && configLoader.getConfig().getBoolean( if (ar.exception != null && configLoader != null && configLoader.getConfig().getBoolean( CarrierConfigManager.KEY_EDITABLE_VOICEMAIL_NUMBER_BOOL)) { // GsmCdmaPhone will store vm number on device // when IccVmNotSupportedException occurred AsyncResult.forMessage(((Message) ar.userObj)).exception = new IccVmNotSupportedException( AsyncResult.forMessage(((Message) ar.userObj)).exception = new IccVmNotSupportedException( "Update SIM voice mailbox error"); } else { AsyncResult.forMessage(((Message) ar.userObj)).exception = ar.exception; AsyncResult.forMessage(((Message) ar.userObj)) .exception = ar.exception; } ((Message) ar.userObj).sendToTarget(); } Loading @@ -1181,8 +1185,7 @@ public class SIMRecords extends IccRecords { mVoiceMailNum = mNewVoiceMailNum; mVoiceMailTag = mNewVoiceMailTag; } else { if (DBG) log("Set CPHS MailBox with exception: " + ar.exception); if (DBG) log("Set CPHS MailBox with exception: " + ar.exception); } if (ar.userObj != null) { if (DBG) log("Callback with CPHS MB successful."); Loading Loading @@ -1248,7 +1251,6 @@ public class SIMRecords extends IccRecords { case EVENT_GET_GID2_DONE: isRecordLoadResponse = true; ar = (AsyncResult) msg.obj; data = (byte[]) ar.result; Loading Loading @@ -1334,8 +1336,8 @@ public class SIMRecords extends IccRecords { default: super.handleMessage(msg); // IccRecords handles generic record load responses }}catch (RuntimeException exc) { } } catch (RuntimeException exc) { // I don't want these exceptions to be fatal logw("Exception parsing SIM record", exc); } finally { Loading Loading @@ -1845,10 +1847,10 @@ public class SIMRecords extends IccRecords { if (start) { // Check previous state to see if there is outstanding // SPN read if(mSpnState == GetSpnFsmState.READ_SPN_3GPP || mSpnState == GetSpnFsmState.READ_SPN_CPHS || mSpnState == GetSpnFsmState.READ_SPN_SHORT_CPHS || mSpnState == GetSpnFsmState.INIT) { if (mSpnState == GetSpnFsmState.READ_SPN_3GPP || mSpnState == GetSpnFsmState.READ_SPN_CPHS || mSpnState == GetSpnFsmState.READ_SPN_SHORT_CPHS || mSpnState == GetSpnFsmState.INIT) { // Set INIT then return so the INIT code // will run when the outstanding read done. mSpnState = GetSpnFsmState.INIT; Loading