Bug 793073 - B2G RIL: Quickly tapping Airplane Mode causes phone keeping in Emergency Calls Only. r=philikon

This commit is contained in:
vliu 2012-09-28 10:53:29 +08:00
parent e8b33a2308
commit 4d96e1fbb8

View File

@ -787,6 +787,8 @@ RadioInterfaceLayer.prototype = {
},
handleRadioStateChange: function handleRadioStateChange(message) {
this._changingRadioPower = false;
let newState = message.radioState;
if (this.rilContext.radioState == newState) {
return;
@ -815,6 +817,10 @@ RadioInterfaceLayer.prototype = {
// yet. Wait for that.
return;
}
if (this._changingRadioPower) {
// We're changing the radio power currently, ignore any changes.
return;
}
if (this.rilContext.radioState == RIL.GECKO_RADIOSTATE_OFF &&
this._radioEnabled) {
@ -1338,6 +1344,10 @@ RadioInterfaceLayer.prototype = {
// corresponds to the 'ril.radio.disabled' setting from the UI.
_radioEnabled: null,
// Flag to ignore any radio power change requests during We're changing
// the radio power.
_changingRadioPower: false,
// Flag to determine whether we reject a waiting call directly or we
// notify the UI of a waiting call. It corresponds to the
// 'ril.callwaiting.enbled' setting from the UI.
@ -1433,6 +1443,7 @@ RadioInterfaceLayer.prototype = {
setRadioEnabled: function setRadioEnabled(value) {
debug("Setting radio power to " + value);
this._changingRadioPower = true;
this.worker.postMessage({rilMessageType: "setRadioPower", on: value});
},