Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +5 −0 Original line number Diff line number Diff line Loading @@ -2890,6 +2890,11 @@ public class GsmCdmaPhone extends Phone { } } @Override public SIMRecords getSIMRecords() { return mSimRecords; } private void processIccRecordEvents(int eventCode) { switch (eventCode) { case IccRecords.EVENT_CFI: Loading src/java/com/android/internal/telephony/Phone.java +5 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType; import com.android.internal.telephony.uicc.IccFileHandler; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.IsimRecords; import com.android.internal.telephony.uicc.SIMRecords; import com.android.internal.telephony.uicc.UiccCard; import com.android.internal.telephony.uicc.UiccCardApplication; import com.android.internal.telephony.uicc.UiccController; Loading Loading @@ -4109,6 +4110,10 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { return RIL.RADIO_HAL_VERSION_UNKNOWN; } public SIMRecords getSIMRecords() { return null; } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("Phone: subId=" + getSubId()); pw.println(" mPhoneId=" + mPhoneId); Loading src/java/com/android/internal/telephony/dataconnection/DcTracker.java +33 −8 Original line number Diff line number Diff line Loading @@ -111,6 +111,8 @@ import com.android.internal.telephony.dataconnection.DataConnectionReasons.DataD import com.android.internal.telephony.dataconnection.DataEnabledSettings.DataEnabledChangedReason; import com.android.internal.telephony.metrics.TelephonyMetrics; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.RuimRecords; import com.android.internal.telephony.uicc.SIMRecords; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.util.ArrayUtils; import com.android.internal.util.AsyncChannel; Loading Loading @@ -232,6 +234,7 @@ public class DcTracker extends Handler { private final TelephonyManager mTelephonyManager; private final AlarmManager mAlarmManager; private SIMRecords mSimRecords; /* Currently requested APN type (TODO: This should probably be a parameter not a member) */ private int mRequestedApnType = ApnSetting.TYPE_DEFAULT; Loading @@ -250,6 +253,8 @@ public class DcTracker extends Handler { // Default sent packets without ack which triggers initial recovery steps private static final int NUMBER_SENT_PACKETS_OF_HANG = 10; private static final int EVENT_ESSENTIAL_SIM_RECORDS_LOADED = 100; // Default for the data stall alarm while non-aggressive stall detection private static final int DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS_DEFAULT = 1000 * 60 * 6; // Default for the data stall alarm for aggressive stall detection Loading Loading @@ -1362,7 +1367,8 @@ public class DcTracker extends Handler { radioStateFromCarrier = true; } boolean recordsLoaded = mIccRecords.get() != null && mIccRecords.get().getRecordsLoaded(); boolean recordsLoaded = mIccRecords.get() != null && mIccRecords.get().getEssentialRecordsLoaded(); boolean defaultDataSelected = SubscriptionManager.isValidSubscriptionId( SubscriptionManager.getDefaultDataSubscriptionId()); Loading Loading @@ -3550,6 +3556,17 @@ public class DcTracker extends Handler { return null; } void onRecordsLoaded() { // If onRecordsLoadedOrSubIdChanged() is not called here, it should be called on // onSubscriptionsChanged() when a valid subId is available. int subId = mPhone.getSubId(); if (mSubscriptionManager.isActiveSubId(subId)) { onRecordsLoadedOrSubIdChanged(); } else { log("Ignoring EVENT_ESSENTIAL_SIM_RECORDS_LOADED as subId is not valid: " + subId); } } @Override public void handleMessage (Message msg) { if (VDBG) log("handleMessage msg=" + msg); Loading @@ -3561,13 +3578,21 @@ public class DcTracker extends Handler { int requestType; switch (msg.what) { case DctConstants.EVENT_RECORDS_LOADED: // If onRecordsLoadedOrSubIdChanged() is not called here, it should be called on // onSubscriptionsChanged() when a valid subId is available. int subId = mPhone.getSubId(); if (mSubscriptionManager.isActiveSubId(subId)) { onRecordsLoadedOrSubIdChanged(); mSimRecords = mPhone.getSIMRecords(); if ((mIccRecords.get() instanceof RuimRecords) && (mSimRecords != null)) { mSimRecords.registerForEssentialRecordsLoaded( this, EVENT_ESSENTIAL_SIM_RECORDS_LOADED, null); } else { log("Ignoring EVENT_RECORDS_LOADED as subId is not valid: " + subId); onRecordsLoaded(); } break; case EVENT_ESSENTIAL_SIM_RECORDS_LOADED: if (DBG) log("EVENT_ESSENTIAL_SIM_RECORDS_LOADED"); onRecordsLoaded(); if (mSimRecords != null) { mSimRecords.unregisterForEssentialRecordsLoaded(this); mSimRecords = null; } break; Loading Loading @@ -3983,7 +4008,7 @@ public class DcTracker extends Handler { if (mSubscriptionManager.isActiveSubId(mPhone.getSubId())) { log("New records found."); mIccRecords.set(newIccRecords); newIccRecords.registerForRecordsLoaded( newIccRecords.registerForEssentialRecordsLoaded( this, DctConstants.EVENT_RECORDS_LOADED, null); } } else { Loading src/java/com/android/internal/telephony/uicc/IccRecords.java +42 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ public abstract class IccRecords extends Handler implements IccConstants { protected TelephonyManager mTelephonyManager; protected RegistrantList mRecordsLoadedRegistrants = new RegistrantList(); protected RegistrantList mEssentialRecordsLoadedRegistrants = new RegistrantList(); protected RegistrantList mLockedRecordsLoadedRegistrants = new RegistrantList(); protected RegistrantList mNetworkLockedRecordsLoadedRegistrants = new RegistrantList(); protected RegistrantList mImsiReadyRegistrants = new RegistrantList(); Loading @@ -102,6 +103,12 @@ public abstract class IccRecords extends Handler implements IccConstants { protected RegistrantList mSpnUpdatedRegistrants = new RegistrantList(); protected RegistrantList mRecordsOverrideRegistrants = new RegistrantList(); @UnsupportedAppUsage protected boolean mEssentialRecordsListenerNotified; @UnsupportedAppUsage protected int mEssentialRecordsToLoad; // number of pending essential records load requests @UnsupportedAppUsage protected int mRecordsToLoad; // number of pending load requests Loading Loading @@ -232,6 +239,7 @@ public abstract class IccRecords extends Handler implements IccConstants { + " mCi=" + mCi + " mFh=" + mFh + " mParentApp=" + mParentApp + " mEssentialRecordsToLoad=" + mEssentialRecordsToLoad + " recordsToLoad=" + mRecordsToLoad + " adnCache=" + mAdnCache + " recordsRequested=" + mRecordsRequested Loading Loading @@ -370,6 +378,20 @@ public abstract class IccRecords extends Handler implements IccConstants { return mFullIccId; } @UnsupportedAppUsage public void registerForEssentialRecordsLoaded(Handler h, int what, Object obj) { if (mDestroyed.get()) { return; } Registrant r = new Registrant(h, what, obj); mEssentialRecordsLoadedRegistrants.add(r); if (getEssentialRecordsLoaded()) { r.notifyRegistrant(new AsyncResult(null, null, null)); } } @UnsupportedAppUsage public void registerForRecordsLoaded(Handler h, int what, Object obj) { if (mDestroyed.get()) { Loading @@ -383,6 +405,12 @@ public abstract class IccRecords extends Handler implements IccConstants { r.notifyRegistrant(new AsyncResult(null, null, null)); } } @UnsupportedAppUsage public void unregisterForEssentialRecordsLoaded(Handler h) { mEssentialRecordsLoadedRegistrants.remove(h); } @UnsupportedAppUsage public void unregisterForRecordsLoaded(Handler h) { mRecordsLoadedRegistrants.remove(h); Loading Loading @@ -771,6 +799,11 @@ public abstract class IccRecords extends Handler implements IccConstants { */ public abstract void onRefresh(boolean fileChanged, int[] fileList); @UnsupportedAppUsage public boolean getEssentialRecordsLoaded() { return mEssentialRecordsToLoad == 0 && mRecordsRequested; } @UnsupportedAppUsage public boolean getRecordsLoaded() { return mRecordsToLoad == 0 && mRecordsRequested; Loading Loading @@ -919,6 +952,8 @@ public abstract class IccRecords extends Handler implements IccConstants { protected abstract void onRecordLoaded(); protected abstract void onAllEssentialRecordsLoaded(); protected abstract void onAllRecordsLoaded(); /** Loading Loading @@ -1187,6 +1222,12 @@ public abstract class IccRecords extends Handler implements IccConstants { pw.println(" mCi=" + mCi); pw.println(" mFh=" + mFh); pw.println(" mParentApp=" + mParentApp); pw.println(" mEssentialRecordsLoadedRegistrants: size=" + mEssentialRecordsLoadedRegistrants.size()); for (int i = 0; i < mEssentialRecordsLoadedRegistrants.size(); i++) { pw.println(" mEssentialRecordsLoadedRegistrants[" + i + "]=" + ((Registrant)mEssentialRecordsLoadedRegistrants.get(i)).getHandler()); } pw.println(" recordsLoadedRegistrants: size=" + mRecordsLoadedRegistrants.size()); for (int i = 0; i < mRecordsLoadedRegistrants.size(); i++) { pw.println(" recordsLoadedRegistrants[" + i + "]=" Loading Loading @@ -1227,6 +1268,7 @@ public abstract class IccRecords extends Handler implements IccConstants { } pw.println(" mRecordsRequested=" + mRecordsRequested); pw.println(" mLockedRecordsReqReason=" + mLockedRecordsReqReason); pw.println(" mEssentialRecordsToLoad=" + mEssentialRecordsToLoad); pw.println(" mRecordsToLoad=" + mRecordsToLoad); pw.println(" mRdnCache=" + mAdnCache); Loading src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java +21 −2 Original line number Diff line number Diff line Loading @@ -154,9 +154,16 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { } } private void fetchEssentialIsimRecords() { //NOP: No essential ISim records identified. } @UnsupportedAppUsage protected void fetchIsimRecords() { mRecordsRequested = true; if (DBG) log("fetchIsimRecords " + mRecordsToLoad); fetchEssentialIsimRecords(); mFh.loadEFTransparent(EF_IMPI, obtainMessage( IccRecords.EVENT_GET_ICC_RECORD_DONE, new EfIsimImpiLoaded())); Loading Loading @@ -289,13 +296,18 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { mRecordsToLoad -= 1; if (DBG) log("onRecordLoaded " + mRecordsToLoad + " requested: " + mRecordsRequested); if (getEssentialRecordsLoaded() && !mEssentialRecordsListenerNotified) { onAllEssentialRecordsLoaded(); } if (getRecordsLoaded()) { onAllRecordsLoaded(); } else if (getLockedRecordsLoaded() || getNetworkLockedRecordsLoaded()) { onLockedAllRecordsLoaded(); } else if (mRecordsToLoad < 0) { } else if (mRecordsToLoad < 0 || mEssentialRecordsToLoad < 0) { loge("recordsToLoad <0, programmer error suspected"); mRecordsToLoad = 0; mEssentialRecordsToLoad = 0; } } Loading @@ -312,6 +324,13 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { } } @Override protected void onAllEssentialRecordsLoaded() { if (DBG) log("Essential record load complete"); mEssentialRecordsListenerNotified = true; mEssentialRecordsLoadedRegistrants.notifyRegistrants(new AsyncResult(null, null, null)); } @Override protected void onAllRecordsLoaded() { if (DBG) log("record load complete"); Loading Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +5 −0 Original line number Diff line number Diff line Loading @@ -2890,6 +2890,11 @@ public class GsmCdmaPhone extends Phone { } } @Override public SIMRecords getSIMRecords() { return mSimRecords; } private void processIccRecordEvents(int eventCode) { switch (eventCode) { case IccRecords.EVENT_CFI: Loading
src/java/com/android/internal/telephony/Phone.java +5 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType; import com.android.internal.telephony.uicc.IccFileHandler; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.IsimRecords; import com.android.internal.telephony.uicc.SIMRecords; import com.android.internal.telephony.uicc.UiccCard; import com.android.internal.telephony.uicc.UiccCardApplication; import com.android.internal.telephony.uicc.UiccController; Loading Loading @@ -4109,6 +4110,10 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { return RIL.RADIO_HAL_VERSION_UNKNOWN; } public SIMRecords getSIMRecords() { return null; } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("Phone: subId=" + getSubId()); pw.println(" mPhoneId=" + mPhoneId); Loading
src/java/com/android/internal/telephony/dataconnection/DcTracker.java +33 −8 Original line number Diff line number Diff line Loading @@ -111,6 +111,8 @@ import com.android.internal.telephony.dataconnection.DataConnectionReasons.DataD import com.android.internal.telephony.dataconnection.DataEnabledSettings.DataEnabledChangedReason; import com.android.internal.telephony.metrics.TelephonyMetrics; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.RuimRecords; import com.android.internal.telephony.uicc.SIMRecords; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.util.ArrayUtils; import com.android.internal.util.AsyncChannel; Loading Loading @@ -232,6 +234,7 @@ public class DcTracker extends Handler { private final TelephonyManager mTelephonyManager; private final AlarmManager mAlarmManager; private SIMRecords mSimRecords; /* Currently requested APN type (TODO: This should probably be a parameter not a member) */ private int mRequestedApnType = ApnSetting.TYPE_DEFAULT; Loading @@ -250,6 +253,8 @@ public class DcTracker extends Handler { // Default sent packets without ack which triggers initial recovery steps private static final int NUMBER_SENT_PACKETS_OF_HANG = 10; private static final int EVENT_ESSENTIAL_SIM_RECORDS_LOADED = 100; // Default for the data stall alarm while non-aggressive stall detection private static final int DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS_DEFAULT = 1000 * 60 * 6; // Default for the data stall alarm for aggressive stall detection Loading Loading @@ -1362,7 +1367,8 @@ public class DcTracker extends Handler { radioStateFromCarrier = true; } boolean recordsLoaded = mIccRecords.get() != null && mIccRecords.get().getRecordsLoaded(); boolean recordsLoaded = mIccRecords.get() != null && mIccRecords.get().getEssentialRecordsLoaded(); boolean defaultDataSelected = SubscriptionManager.isValidSubscriptionId( SubscriptionManager.getDefaultDataSubscriptionId()); Loading Loading @@ -3550,6 +3556,17 @@ public class DcTracker extends Handler { return null; } void onRecordsLoaded() { // If onRecordsLoadedOrSubIdChanged() is not called here, it should be called on // onSubscriptionsChanged() when a valid subId is available. int subId = mPhone.getSubId(); if (mSubscriptionManager.isActiveSubId(subId)) { onRecordsLoadedOrSubIdChanged(); } else { log("Ignoring EVENT_ESSENTIAL_SIM_RECORDS_LOADED as subId is not valid: " + subId); } } @Override public void handleMessage (Message msg) { if (VDBG) log("handleMessage msg=" + msg); Loading @@ -3561,13 +3578,21 @@ public class DcTracker extends Handler { int requestType; switch (msg.what) { case DctConstants.EVENT_RECORDS_LOADED: // If onRecordsLoadedOrSubIdChanged() is not called here, it should be called on // onSubscriptionsChanged() when a valid subId is available. int subId = mPhone.getSubId(); if (mSubscriptionManager.isActiveSubId(subId)) { onRecordsLoadedOrSubIdChanged(); mSimRecords = mPhone.getSIMRecords(); if ((mIccRecords.get() instanceof RuimRecords) && (mSimRecords != null)) { mSimRecords.registerForEssentialRecordsLoaded( this, EVENT_ESSENTIAL_SIM_RECORDS_LOADED, null); } else { log("Ignoring EVENT_RECORDS_LOADED as subId is not valid: " + subId); onRecordsLoaded(); } break; case EVENT_ESSENTIAL_SIM_RECORDS_LOADED: if (DBG) log("EVENT_ESSENTIAL_SIM_RECORDS_LOADED"); onRecordsLoaded(); if (mSimRecords != null) { mSimRecords.unregisterForEssentialRecordsLoaded(this); mSimRecords = null; } break; Loading Loading @@ -3983,7 +4008,7 @@ public class DcTracker extends Handler { if (mSubscriptionManager.isActiveSubId(mPhone.getSubId())) { log("New records found."); mIccRecords.set(newIccRecords); newIccRecords.registerForRecordsLoaded( newIccRecords.registerForEssentialRecordsLoaded( this, DctConstants.EVENT_RECORDS_LOADED, null); } } else { Loading
src/java/com/android/internal/telephony/uicc/IccRecords.java +42 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ public abstract class IccRecords extends Handler implements IccConstants { protected TelephonyManager mTelephonyManager; protected RegistrantList mRecordsLoadedRegistrants = new RegistrantList(); protected RegistrantList mEssentialRecordsLoadedRegistrants = new RegistrantList(); protected RegistrantList mLockedRecordsLoadedRegistrants = new RegistrantList(); protected RegistrantList mNetworkLockedRecordsLoadedRegistrants = new RegistrantList(); protected RegistrantList mImsiReadyRegistrants = new RegistrantList(); Loading @@ -102,6 +103,12 @@ public abstract class IccRecords extends Handler implements IccConstants { protected RegistrantList mSpnUpdatedRegistrants = new RegistrantList(); protected RegistrantList mRecordsOverrideRegistrants = new RegistrantList(); @UnsupportedAppUsage protected boolean mEssentialRecordsListenerNotified; @UnsupportedAppUsage protected int mEssentialRecordsToLoad; // number of pending essential records load requests @UnsupportedAppUsage protected int mRecordsToLoad; // number of pending load requests Loading Loading @@ -232,6 +239,7 @@ public abstract class IccRecords extends Handler implements IccConstants { + " mCi=" + mCi + " mFh=" + mFh + " mParentApp=" + mParentApp + " mEssentialRecordsToLoad=" + mEssentialRecordsToLoad + " recordsToLoad=" + mRecordsToLoad + " adnCache=" + mAdnCache + " recordsRequested=" + mRecordsRequested Loading Loading @@ -370,6 +378,20 @@ public abstract class IccRecords extends Handler implements IccConstants { return mFullIccId; } @UnsupportedAppUsage public void registerForEssentialRecordsLoaded(Handler h, int what, Object obj) { if (mDestroyed.get()) { return; } Registrant r = new Registrant(h, what, obj); mEssentialRecordsLoadedRegistrants.add(r); if (getEssentialRecordsLoaded()) { r.notifyRegistrant(new AsyncResult(null, null, null)); } } @UnsupportedAppUsage public void registerForRecordsLoaded(Handler h, int what, Object obj) { if (mDestroyed.get()) { Loading @@ -383,6 +405,12 @@ public abstract class IccRecords extends Handler implements IccConstants { r.notifyRegistrant(new AsyncResult(null, null, null)); } } @UnsupportedAppUsage public void unregisterForEssentialRecordsLoaded(Handler h) { mEssentialRecordsLoadedRegistrants.remove(h); } @UnsupportedAppUsage public void unregisterForRecordsLoaded(Handler h) { mRecordsLoadedRegistrants.remove(h); Loading Loading @@ -771,6 +799,11 @@ public abstract class IccRecords extends Handler implements IccConstants { */ public abstract void onRefresh(boolean fileChanged, int[] fileList); @UnsupportedAppUsage public boolean getEssentialRecordsLoaded() { return mEssentialRecordsToLoad == 0 && mRecordsRequested; } @UnsupportedAppUsage public boolean getRecordsLoaded() { return mRecordsToLoad == 0 && mRecordsRequested; Loading Loading @@ -919,6 +952,8 @@ public abstract class IccRecords extends Handler implements IccConstants { protected abstract void onRecordLoaded(); protected abstract void onAllEssentialRecordsLoaded(); protected abstract void onAllRecordsLoaded(); /** Loading Loading @@ -1187,6 +1222,12 @@ public abstract class IccRecords extends Handler implements IccConstants { pw.println(" mCi=" + mCi); pw.println(" mFh=" + mFh); pw.println(" mParentApp=" + mParentApp); pw.println(" mEssentialRecordsLoadedRegistrants: size=" + mEssentialRecordsLoadedRegistrants.size()); for (int i = 0; i < mEssentialRecordsLoadedRegistrants.size(); i++) { pw.println(" mEssentialRecordsLoadedRegistrants[" + i + "]=" + ((Registrant)mEssentialRecordsLoadedRegistrants.get(i)).getHandler()); } pw.println(" recordsLoadedRegistrants: size=" + mRecordsLoadedRegistrants.size()); for (int i = 0; i < mRecordsLoadedRegistrants.size(); i++) { pw.println(" recordsLoadedRegistrants[" + i + "]=" Loading Loading @@ -1227,6 +1268,7 @@ public abstract class IccRecords extends Handler implements IccConstants { } pw.println(" mRecordsRequested=" + mRecordsRequested); pw.println(" mLockedRecordsReqReason=" + mLockedRecordsReqReason); pw.println(" mEssentialRecordsToLoad=" + mEssentialRecordsToLoad); pw.println(" mRecordsToLoad=" + mRecordsToLoad); pw.println(" mRdnCache=" + mAdnCache); Loading
src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java +21 −2 Original line number Diff line number Diff line Loading @@ -154,9 +154,16 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { } } private void fetchEssentialIsimRecords() { //NOP: No essential ISim records identified. } @UnsupportedAppUsage protected void fetchIsimRecords() { mRecordsRequested = true; if (DBG) log("fetchIsimRecords " + mRecordsToLoad); fetchEssentialIsimRecords(); mFh.loadEFTransparent(EF_IMPI, obtainMessage( IccRecords.EVENT_GET_ICC_RECORD_DONE, new EfIsimImpiLoaded())); Loading Loading @@ -289,13 +296,18 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { mRecordsToLoad -= 1; if (DBG) log("onRecordLoaded " + mRecordsToLoad + " requested: " + mRecordsRequested); if (getEssentialRecordsLoaded() && !mEssentialRecordsListenerNotified) { onAllEssentialRecordsLoaded(); } if (getRecordsLoaded()) { onAllRecordsLoaded(); } else if (getLockedRecordsLoaded() || getNetworkLockedRecordsLoaded()) { onLockedAllRecordsLoaded(); } else if (mRecordsToLoad < 0) { } else if (mRecordsToLoad < 0 || mEssentialRecordsToLoad < 0) { loge("recordsToLoad <0, programmer error suspected"); mRecordsToLoad = 0; mEssentialRecordsToLoad = 0; } } Loading @@ -312,6 +324,13 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { } } @Override protected void onAllEssentialRecordsLoaded() { if (DBG) log("Essential record load complete"); mEssentialRecordsListenerNotified = true; mEssentialRecordsLoadedRegistrants.notifyRegistrants(new AsyncResult(null, null, null)); } @Override protected void onAllRecordsLoaded() { if (DBG) log("record load complete"); Loading