Further fix for SIM detection.
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
This commit is contained in:
committed by
Wink Saville
parent
8075fe48bf
commit
57675037aa
@@ -785,7 +785,18 @@ public abstract class IccCard {
|
|||||||
if (right == IccCard.State.ABSENT) return left;
|
if (right == IccCard.State.ABSENT) return left;
|
||||||
if (left == IccCard.State.ABSENT) return right;
|
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 (right == IccCard.State.NOT_READY) return left;
|
||||||
if (left == IccCard.State.NOT_READY) return right;
|
if (left == IccCard.State.NOT_READY) return right;
|
||||||
|
|
||||||
|
|||||||
@@ -48,22 +48,37 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
|
|
||||||
public CdmaLteServiceStateTracker(CDMALTEPhone phone) {
|
public CdmaLteServiceStateTracker(CDMALTEPhone phone) {
|
||||||
super(phone);
|
super(phone);
|
||||||
|
cm.registerForSIMReady(this, EVENT_SIM_READY, null);
|
||||||
mCdmaLtePhone = phone;
|
mCdmaLtePhone = phone;
|
||||||
|
|
||||||
mLteSS = new ServiceState();
|
mLteSS = new ServiceState();
|
||||||
if (DBG) log("CdmaLteServiceStateTracker Constructors");
|
if (DBG) log("CdmaLteServiceStateTracker Constructors");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose() {
|
||||||
|
cm.unregisterForSIMReady(this);
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
AsyncResult ar;
|
AsyncResult ar;
|
||||||
int[] ints;
|
int[] ints;
|
||||||
String[] strings;
|
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");
|
if (DBG) log("handleMessage EVENT_POLL_STATE_GPRS");
|
||||||
ar = (AsyncResult)msg.obj;
|
ar = (AsyncResult)msg.obj;
|
||||||
handlePollStateResult(msg.what, ar);
|
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);
|
super.handleMessage(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
private boolean mIsMinInfoReady = false;
|
private boolean mIsMinInfoReady = false;
|
||||||
|
|
||||||
private boolean isEriTextLoaded = false;
|
private boolean isEriTextLoaded = false;
|
||||||
private boolean isSubscriptionFromRuim = false;
|
protected boolean isSubscriptionFromRuim = false;
|
||||||
|
|
||||||
/* Used only for debugging purposes. */
|
/* Used only for debugging purposes. */
|
||||||
private String mRegistrationDeniedReason;
|
private String mRegistrationDeniedReason;
|
||||||
@@ -1120,7 +1120,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
* This code should probably be hoisted to the base class so
|
* This code should probably be hoisted to the base class so
|
||||||
* the fix, when added, works for both.
|
* the fix, when added, works for both.
|
||||||
*/
|
*/
|
||||||
private void
|
protected void
|
||||||
queueNextSignalStrengthPoll() {
|
queueNextSignalStrengthPoll() {
|
||||||
if (dontPollSignalStrength || (cm.getRadioState().isGsm())) {
|
if (dontPollSignalStrength || (cm.getRadioState().isGsm())) {
|
||||||
// The radio is telling us about signal strength changes
|
// The radio is telling us about signal strength changes
|
||||||
|
|||||||
@@ -181,8 +181,11 @@ public final class SIMRecords extends IccRecords {
|
|||||||
// recordsToLoad is set to 0 because no requests are made yet
|
// recordsToLoad is set to 0 because no requests are made yet
|
||||||
recordsToLoad = 0;
|
recordsToLoad = 0;
|
||||||
|
|
||||||
|
// 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.registerForSIMReady(this, EVENT_SIM_READY, null);
|
||||||
|
}
|
||||||
p.mCM.registerForOffOrNotAvailable(
|
p.mCM.registerForOffOrNotAvailable(
|
||||||
this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
|
this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
|
||||||
p.mCM.setOnSmsOnSim(this, EVENT_SMS_ON_SIM, null);
|
p.mCM.setOnSmsOnSim(this, EVENT_SMS_ON_SIM, null);
|
||||||
@@ -196,7 +199,9 @@ public final class SIMRecords extends IccRecords {
|
|||||||
@Override
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
//Unregister for all events
|
//Unregister for all events
|
||||||
|
if (phone.getLteOnCdmaMode() != Phone.LTE_ON_CDMA_TRUE) {
|
||||||
phone.mCM.unregisterForSIMReady(this);
|
phone.mCM.unregisterForSIMReady(this);
|
||||||
|
}
|
||||||
phone.mCM.unregisterForOffOrNotAvailable( this);
|
phone.mCM.unregisterForOffOrNotAvailable( this);
|
||||||
phone.mCM.unregisterForIccRefresh(this);
|
phone.mCM.unregisterForIccRefresh(this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user