Bug 931722 - Part 1: RIL related code change. r=hsinyi

This commit is contained in:
Shawn Ku 2013-11-27 15:45:31 +08:00
parent 227ca9eaa1
commit cc7e21313f
3 changed files with 12 additions and 23 deletions

View File

@ -728,6 +728,13 @@ RadioInterfaceLayer.prototype = {
}
throw Cr.NS_ERROR_NOT_AVAILABLE;
},
setMicrophoneMuted: function setMicrophoneMuted(muted) {
for (let clientId = 0; clientId < this.numRadioInterfaces; clientId++) {
let radioInterface = this.radioInterfaces[clientId];
radioInterface.workerMessenger.send("setMute", { muted: muted });
}
}
};

View File

@ -132,7 +132,7 @@ interface nsIRadioInterface : nsISupports
void getSmscAddress(in nsIMobileMessageCallback request);
};
[scriptable, uuid(70d3a18c-4063-11e3-89de-0f9ec19fd803)]
[scriptable, uuid(86a5c280-5641-11e3-949a-0800200c9a66)]
interface nsIRadioInterfaceLayer : nsISupports
{
readonly attribute unsigned long numRadioInterfaces;
@ -143,4 +143,6 @@ interface nsIRadioInterfaceLayer : nsISupports
* If not available, throws exception; otherwise, a valid number.
*/
unsigned long getClientIdByIccId(in DOMString iccId);
void setMicrophoneMuted(in boolean muted);
};

View File

@ -361,11 +361,6 @@ let RIL = {
*/
this._pendingNetworkInfo = {rilMessageType: "networkinfochanged"};
/**
* Mute or unmute the radio.
*/
this._muted = true;
/**
* USSD session flag.
* Only one USSD session may exist at a time, and the session is assumed
@ -391,17 +386,6 @@ let RIL = {
this.mergedCellBroadcastConfig = null;
},
get muted() {
return this._muted;
},
set muted(val) {
val = Boolean(val);
if (this._muted != val) {
this.setMute(val);
this._muted = val;
}
},
/**
* Parse an integer from a string, falling back to a default value
* if the the provided value is not a string or does not contain a valid
@ -1466,10 +1450,10 @@ let RIL = {
* @param mute
* Boolean to indicate whether to mute or unmute the radio.
*/
setMute: function setMute(mute) {
setMute: function setMute(options) {
Buf.newParcel(REQUEST_SET_MUTE);
Buf.writeInt32(1);
Buf.writeInt32(mute ? 1 : 0);
Buf.writeInt32(options.muted ? 1 : 0);
Buf.sendParcel();
},
@ -3617,10 +3601,6 @@ let RIL = {
if (conferenceChanged) {
this._ensureConference();
}
// Update our mute status. If there is anything in our currentCalls map then
// we know it's a voice call and we should leave audio on.
this.muted = (Object.getOwnPropertyNames(this.currentCalls).length === 0);
},
_ensureConference: function _ensureConference() {