Refining SIM ready condition on UICC w/ multiple apps.
Also migration for RIL to use SIM_READY indication in case of UICC
presence instead of current NV_READY message.
Change-Id: I3445a628e2d32a24292e6a69785fe72422481221
if (right == IccCard.State.ABSENT) return left;
if (left == IccCard.State.ABSENT) return right;
- // Disregards if either is NOT_READY
+ // Only if both are ready, return ready
+ if ((left == IccCard.State.READY) && (right == IccCard.State.READY)) {
+ return State.READY;
+ }
+
+ // Case one is ready, but the other is not.
+ if (((right == IccCard.State.NOT_READY) && (left == IccCard.State.READY)) ||
+ ((left == IccCard.State.NOT_READY) && (right == IccCard.State.READY))) {
+ return IccCard.State.NOT_READY;
+ }
+
+ // At this point, the other state is assumed to be one of locked state
if (right == IccCard.State.NOT_READY) return left;
if (left == IccCard.State.NOT_READY) return right;
public CdmaLteServiceStateTracker(CDMALTEPhone phone) {
super(phone);
+ cm.registerForSIMReady(this, EVENT_SIM_READY, null);
mCdmaLtePhone = phone;
mLteSS = new ServiceState();
if (DBG) log("CdmaLteServiceStateTracker Constructors");
}
+ public void dispose() {
+ cm.unregisterForSIMReady(this);
+ super.dispose();
+ }
+
@Override
public void handleMessage(Message msg) {
AsyncResult ar;
int[] ints;
String[] strings;
- if (msg.what == EVENT_POLL_STATE_GPRS) {
+ switch (msg.what) {
+ case EVENT_POLL_STATE_GPRS:
if (DBG) log("handleMessage EVENT_POLL_STATE_GPRS");
ar = (AsyncResult)msg.obj;
handlePollStateResult(msg.what, ar);
- } else {
+ break;
+ case EVENT_SIM_READY:
+ isSubscriptionFromRuim = false;
+ cm.getCDMASubscription( obtainMessage(EVENT_POLL_STATE_CDMA_SUBSCRIPTION));
+ pollState();
+ // Signal strength polling stops when radio is off.
+ queueNextSignalStrengthPoll();
+ break;
+ default:
super.handleMessage(msg);
}
}
private boolean mIsMinInfoReady = false;
private boolean isEriTextLoaded = false;
- private boolean isSubscriptionFromRuim = false;
+ protected boolean isSubscriptionFromRuim = false;
/* Used only for debugging purposes. */
private String mRegistrationDeniedReason;
* This code should probably be hoisted to the base class so
* the fix, when added, works for both.
*/
- private void
+ protected void
queueNextSignalStrengthPoll() {
if (dontPollSignalStrength || (cm.getRadioState().isGsm())) {
// The radio is telling us about signal strength changes
// recordsToLoad is set to 0 because no requests are made yet
recordsToLoad = 0;
-
- p.mCM.registerForSIMReady(this, EVENT_SIM_READY, null);
+ // SIMRecord is used by CDMA+LTE mode, and SIM_READY event
+ // will be subscribed by CdmaLteServiceStateTracker.
+ if (phone.getLteOnCdmaMode() != Phone.LTE_ON_CDMA_TRUE) {
+ p.mCM.registerForSIMReady(this, EVENT_SIM_READY, null);
+ }
p.mCM.registerForOffOrNotAvailable(
this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
p.mCM.setOnSmsOnSim(this, EVENT_SMS_ON_SIM, null);
@Override
public void dispose() {
//Unregister for all events
- phone.mCM.unregisterForSIMReady(this);
+ if (phone.getLteOnCdmaMode() != Phone.LTE_ON_CDMA_TRUE) {
+ phone.mCM.unregisterForSIMReady(this);
+ }
phone.mCM.unregisterForOffOrNotAvailable( this);
phone.mCM.unregisterForIccRefresh(this);
}