Bug 837755 - [b2g-ril] SIM is being reported as 'absent' when airplane mode is on. r=qDot, a=lsblakk

This commit is contained in:
Jose Antonio Olivera Ortega 2013-03-21 11:47:51 -04:00
Родитель 0ad814c041
Коммит dbbfc41400
1 изменённых файлов: 23 добавлений и 15 удалений

Просмотреть файл

@ -731,7 +731,7 @@ let RIL = {
/**
* Card state
*/
this.cardState = null;
this.cardState = GECKO_CARDSTATE_UNKNOWN;
/**
* Strings
@ -3762,14 +3762,27 @@ let RIL = {
*/
_processICCStatus: function _processICCStatus(iccStatus) {
this.iccStatus = iccStatus;
let newCardState;
if ((!iccStatus) || (iccStatus.cardState == CARD_STATE_ABSENT)) {
if (DEBUG) debug("ICC absent");
if (this.cardState == GECKO_CARDSTATE_ABSENT) {
this.operator = null;
switch (this.radioState) {
case GECKO_RADIOSTATE_UNAVAILABLE:
newCardState = GECKO_CARDSTATE_UNKNOWN;
break;
case GECKO_RADIOSTATE_OFF:
newCardState = GECKO_CARDSTATE_NOT_READY;
break;
case GECKO_RADIOSTATE_READY:
if (DEBUG) {
debug("ICC absent");
}
newCardState = GECKO_CARDSTATE_ABSENT;
break;
}
if (newCardState == this.cardState) {
return;
}
this.cardState = GECKO_CARDSTATE_ABSENT;
this.cardState = newCardState;
this.sendDOMMessage({rilMessageType: "cardstatechange",
cardState: this.cardState});
return;
@ -3778,15 +3791,13 @@ let RIL = {
// TODO: Bug 726098, change to use cdmaSubscriptionAppIndex when in CDMA.
let index = iccStatus.gsmUmtsSubscriptionAppIndex;
let app = iccStatus.apps[index];
if (!app) {
if (DEBUG) {
debug("Subscription application is not present in iccStatus.");
}
if (this.cardState == GECKO_CARDSTATE_ABSENT) {
if (iccStatus.cardState == CARD_STATE_ERROR || !app) {
if (this.cardState == GECKO_CARDSTATE_UNKNOWN) {
this.operator = null;
return;
}
this.cardState = GECKO_CARDSTATE_ABSENT;
this.operator = null;
this.cardState = GECKO_CARDSTATE_UNKNOWN;
this.sendDOMMessage({rilMessageType: "cardstatechange",
cardState: this.cardState});
return;
@ -3795,7 +3806,6 @@ let RIL = {
this.aid = app.aid;
this.appType = app.app_type;
let newCardState;
switch (app.app_state) {
case CARD_APPSTATE_PIN:
newCardState = GECKO_CARDSTATE_PIN_REQUIRED;
@ -3810,11 +3820,9 @@ let RIL = {
newCardState = GECKO_CARDSTATE_READY;
break;
case CARD_APPSTATE_UNKNOWN:
newCardState = GECKO_CARDSTATE_UNKNOWN;
break;
case CARD_APPSTATE_DETECTED:
default:
newCardState = GECKO_CARDSTATE_NOT_READY;
newCardState = GECKO_CARDSTATE_UNKNOWN;
}
if (this.cardState == newCardState) {