mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 816101 - Send a system message when a call is complete. r=hsinyi
This commit is contained in:
parent
9443517959
commit
f7eda2f2b7
@ -79,6 +79,9 @@ this.SystemMessagePermissionsTable = {
|
||||
"telephony-new-call": {
|
||||
"telephony": []
|
||||
},
|
||||
"telephony-call-ended": {
|
||||
"telephony": []
|
||||
},
|
||||
"ussd-received": {
|
||||
"mobileconnection": []
|
||||
}
|
||||
|
@ -1242,6 +1242,14 @@ RadioInterfaceLayer.prototype = {
|
||||
handleCallDisconnected: function handleCallDisconnected(call) {
|
||||
debug("handleCallDisconnected: " + JSON.stringify(call));
|
||||
call.state = nsIRadioInterfaceLayer.CALL_STATE_DISCONNECTED;
|
||||
let duration = ("started" in call && typeof call.started == "number") ?
|
||||
new Date().getTime() - call.started : 0;
|
||||
let data = {
|
||||
number: call.number,
|
||||
duration: duration,
|
||||
direction: call.direction
|
||||
};
|
||||
gSystemMessenger.broadcastMessage("telephony-call-ended", data);
|
||||
this.updateCallAudioState(call);
|
||||
this._sendTargetMessage("telephony", "RIL:CallStateChanged", call);
|
||||
},
|
||||
|
@ -4302,6 +4302,9 @@ let RIL = {
|
||||
// Call is still valid.
|
||||
if (newCall.state != currentCall.state) {
|
||||
// State has changed.
|
||||
if (!currentCall.started && newCall.state == CALL_STATE_ACTIVE) {
|
||||
currentCall.started = new Date().getTime();
|
||||
}
|
||||
currentCall.state = newCall.state;
|
||||
this._handleChangedCallState(currentCall);
|
||||
}
|
||||
@ -4322,6 +4325,11 @@ let RIL = {
|
||||
newCall.number[0] != "+") {
|
||||
newCall.number = "+" + newCall.number;
|
||||
}
|
||||
if (newCall.state == CALL_STATE_INCOMING) {
|
||||
newCall.direction = 'incoming';
|
||||
} else if (newCall.state == CALL_STATE_DIALING) {
|
||||
newCall.direction = 'outgoing';
|
||||
}
|
||||
// Add to our map.
|
||||
this.currentCalls[newCall.callIndex] = newCall;
|
||||
this._handleChangedCallState(newCall);
|
||||
|
Loading…
Reference in New Issue
Block a user