Bug 738558: B2G RIL: get cell location and cell id in processRegistrationState in ril_worker.js. r=philikon

This commit is contained in:
Yoshi Huang 2012-05-31 13:31:56 +08:00
Родитель 96840fd7b5
Коммит 838b6712a6
2 изменённых файлов: 29 добавлений и 0 удалений

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

@ -141,6 +141,7 @@ function RadioInterfaceLayer() {
radioState: RIL.GECKO_RADIOSTATE_UNAVAILABLE,
cardState: RIL.GECKO_CARDSTATE_UNAVAILABLE,
icc: null,
cell: null,
// These objects implement the nsIDOMMozMobileConnectionInfo interface,
// although the actual implementation lives in the content process.
@ -356,6 +357,9 @@ RadioInterfaceLayer.prototype = {
callback.receiveContactsList(message.contactType, message.contacts);
}
break;
case "celllocationchanged":
this.radioState.cell = message;
break;
default:
throw new Error("Don't know about this message type: " + message.type);
}

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

@ -601,6 +601,11 @@ let RIL = {
voiceRegistrationState: {},
dataRegistrationState: {},
/**
* The cell location on a phone, such as LAC, CID.
*/
cellLocation: {},
/**
* List of strings identifying the network operator.
*/
@ -1969,6 +1974,26 @@ let RIL = {
}
}
let cell = this.cellLocation;
let cellChanged = false;
// From TS 23.003, 0000 and 0xfffe are indicated that no valid LAI exists
// in MS. So we still need to report the '0000' as well.
if (cell.lac !== state[1]) {
cell.lac = state[1];
cellChanged = true;
}
if (cell.cid !== state[2]) {
cell.cid = state[2];
cellChanged = true;
}
if (cellChanged) {
cell.type = "celllocationchanged";
this.sendDOMMessage(cell);
}
let radioTech = RIL.parseInt(state[3], NETWORK_CREG_TECH_UNKNOWN);
if (rs.radioTech != radioTech) {
rs.radioTech = radioTech;