Bug 720747 - Completely silence RIL worker by default. r=qDot

This commit is contained in:
Philipp von Weitershausen 2012-02-02 10:41:07 -08:00
parent b80e45e273
commit ca578f8c1a
2 changed files with 19 additions and 18 deletions

View File

@ -47,7 +47,7 @@ Cu.import("resource://gre/modules/Services.jsm");
var RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
const DEBUG = true; // set to false to suppress debug messages
const DEBUG = false; // set to true to see debug messages
const RADIOINTERFACELAYER_CID =
Components.ID("{2d831c8d-6017-435b-a80c-e5d422810cea}");

View File

@ -432,7 +432,6 @@ let Buf = {
/**
* Process one parcel.
*/
processParcel: function processParcel() {
let response_type = this.readUint32();
let length = this.readIncoming - UINT32_SIZE;
@ -445,20 +444,24 @@ let Buf = {
request_type = this.tokenRequestMap[token];
if (error) {
//TODO
debug("Received error " + error + " for solicited parcel type " +
request_type);
if (DEBUG) {
debug("Received error " + error + " for solicited parcel type " +
request_type);
}
return;
}
debug("Solicited response for request type " + request_type +
", token " + token);
if (DEBUG) {
debug("Solicited response for request type " + request_type +
", token " + token);
}
delete this.tokenRequestMap[token];
this.lastSolicitedToken = token;
} else if (response_type == RESPONSE_TYPE_UNSOLICITED) {
request_type = this.readUint32();
length -= UINT32_SIZE;
debug("Unsolicited response for request type " + request_type);
if (DEBUG) debug("Unsolicited response for request type " + request_type);
} else {
debug("Unknown response type: " + response_type);
if (DEBUG) debug("Unknown response type: " + response_type);
return;
}
@ -483,9 +486,8 @@ let Buf = {
},
/**
* Communication with the RIL IPC thread.
* Communicate with the RIL IPC thread.
*/
sendParcel: function sendParcel() {
// Compute the size of the parcel and write it to the front of the parcel
// where we left room for it. Note that he parcel size does not include
@ -496,7 +498,7 @@ let Buf = {
// This assumes that postRILMessage will make a copy of the ArrayBufferView
// right away!
let parcel = this.outgoingBytes.subarray(0, this.outgoingIndex);
debug("Outgoing parcel: " + Array.slice(parcel));
if (DEBUG) debug("Outgoing parcel: " + Array.slice(parcel));
postRILMessage(parcel);
this.outgoingIndex = PARCEL_SIZE_SIZE;
},
@ -865,7 +867,7 @@ let RIL = {
handleParcel: function handleParcel(request_type, length) {
let method = this[request_type];
if (typeof method == "function") {
debug("Handling parcel as " + method.name);
if (DEBUG) debug("Handling parcel as " + method.name);
method.call(this, length);
}
}
@ -1218,9 +1220,6 @@ RIL[UNSOLICITED_RESEND_INCALL_MUTE] = null;
*/
let Phone = {
//XXX TODO beware, this is just demo code. It's still missing
// communication with the UI thread.
/**
* One of the RADIO_STATE_* constants.
*/
@ -1313,7 +1312,9 @@ let Phone = {
*/
onRadioStateChanged: function onRadioStateChanged(newState) {
debug("Radio state changed from " + this.radioState + " to " + newState);
if (DEBUG) {
debug("Radio state changed from " + this.radioState + " to " + newState);
}
if (this.radioState == newState) {
// No change in state, return.
return;
@ -1455,13 +1456,13 @@ let Phone = {
},
onNetworkStateChanged: function onNetworkStateChanged() {
debug("Network state changed, re-requesting phone state.");
if (DEBUG) debug("Network state changed, re-requesting phone state.");
this.requestNetworkInfo();
},
onICCStatus: function onICCStatus(iccStatus) {
if (DEBUG) {
debug("iccStatus: " + JSON.stringify(iccStatus));
debug("iccStatus: " + JSON.stringify(iccStatus));
}
this.iccStatus = iccStatus;