Loading src/java/com/android/internal/telephony/CarrierIdentifier.java +2 −0 Original line number Diff line number Diff line Loading @@ -211,11 +211,13 @@ public class CarrierIdentifier extends Handler { if (mIccRecords != null) { logd("Removing stale icc objects."); mIccRecords.unregisterForRecordsLoaded(this); mIccRecords.unregisterForRecordsOverride(this); mIccRecords = null; } if (newIccRecords != null) { logd("new Icc object"); newIccRecords.registerForRecordsLoaded(this, SIM_LOAD_EVENT, null); newIccRecords.registerForRecordsOverride(this, SIM_LOAD_EVENT, null); mIccRecords = newIccRecords; } } Loading src/java/com/android/internal/telephony/uicc/IccRecords.java +20 −1 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ public abstract class IccRecords extends Handler implements IccConstants { protected RegistrantList mNewSmsRegistrants = new RegistrantList(); protected RegistrantList mNetworkSelectionModeAutomaticRegistrants = new RegistrantList(); protected RegistrantList mSpnUpdatedRegistrants = new RegistrantList(); protected RegistrantList mRecordsOverrideRegistrants = new RegistrantList(); protected int mRecordsToLoad; // number of pending load requests Loading Loading @@ -218,7 +219,7 @@ public abstract class IccRecords extends Handler implements IccConstants { mCarrierTestOverride.override(mccmnc, imsi, iccid, gid1, gid2, pnn, spn); mTelephonyManager.setSimOperatorNameForPhone(mParentApp.getPhoneId(), spn); mTelephonyManager.setSimOperatorNumericForPhone(mParentApp.getPhoneId(), mccmnc); mRecordsLoadedRegistrants.notifyRegistrants(); mRecordsOverrideRegistrants.notifyRegistrants(); } /** Loading Loading @@ -308,10 +309,28 @@ public abstract class IccRecords extends Handler implements IccConstants { r.notifyRegistrant(new AsyncResult(null, null, null)); } } public void unregisterForRecordsLoaded(Handler h) { mRecordsLoadedRegistrants.remove(h); } public void unregisterForRecordsOverride(Handler h) { mRecordsOverrideRegistrants.remove(h); } public void registerForRecordsOverride(Handler h, int what, Object obj) { if (mDestroyed.get()) { return; } Registrant r = new Registrant(h, what, obj); mRecordsOverrideRegistrants.add(r); if (getRecordsLoaded()) { r.notifyRegistrant(new AsyncResult(null, null, null)); } } /** * Register to be notified when records are loaded for a PIN or PUK locked SIM */ Loading Loading
src/java/com/android/internal/telephony/CarrierIdentifier.java +2 −0 Original line number Diff line number Diff line Loading @@ -211,11 +211,13 @@ public class CarrierIdentifier extends Handler { if (mIccRecords != null) { logd("Removing stale icc objects."); mIccRecords.unregisterForRecordsLoaded(this); mIccRecords.unregisterForRecordsOverride(this); mIccRecords = null; } if (newIccRecords != null) { logd("new Icc object"); newIccRecords.registerForRecordsLoaded(this, SIM_LOAD_EVENT, null); newIccRecords.registerForRecordsOverride(this, SIM_LOAD_EVENT, null); mIccRecords = newIccRecords; } } Loading
src/java/com/android/internal/telephony/uicc/IccRecords.java +20 −1 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ public abstract class IccRecords extends Handler implements IccConstants { protected RegistrantList mNewSmsRegistrants = new RegistrantList(); protected RegistrantList mNetworkSelectionModeAutomaticRegistrants = new RegistrantList(); protected RegistrantList mSpnUpdatedRegistrants = new RegistrantList(); protected RegistrantList mRecordsOverrideRegistrants = new RegistrantList(); protected int mRecordsToLoad; // number of pending load requests Loading Loading @@ -218,7 +219,7 @@ public abstract class IccRecords extends Handler implements IccConstants { mCarrierTestOverride.override(mccmnc, imsi, iccid, gid1, gid2, pnn, spn); mTelephonyManager.setSimOperatorNameForPhone(mParentApp.getPhoneId(), spn); mTelephonyManager.setSimOperatorNumericForPhone(mParentApp.getPhoneId(), mccmnc); mRecordsLoadedRegistrants.notifyRegistrants(); mRecordsOverrideRegistrants.notifyRegistrants(); } /** Loading Loading @@ -308,10 +309,28 @@ public abstract class IccRecords extends Handler implements IccConstants { r.notifyRegistrant(new AsyncResult(null, null, null)); } } public void unregisterForRecordsLoaded(Handler h) { mRecordsLoadedRegistrants.remove(h); } public void unregisterForRecordsOverride(Handler h) { mRecordsOverrideRegistrants.remove(h); } public void registerForRecordsOverride(Handler h, int what, Object obj) { if (mDestroyed.get()) { return; } Registrant r = new Registrant(h, what, obj); mRecordsOverrideRegistrants.add(r); if (getRecordsLoaded()) { r.notifyRegistrant(new AsyncResult(null, null, null)); } } /** * Register to be notified when records are loaded for a PIN or PUK locked SIM */ Loading