mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1093014 - Part 3: Implement in call MMI. r=hsinyi
This commit is contained in:
parent
813a26d070
commit
beba4b0a74
@ -2876,6 +2876,7 @@ this.MMI_KS_SC_PUK = "scPuk";
|
||||
this.MMI_KS_SC_PUK2 = "scPuk2";
|
||||
this.MMI_KS_SC_IMEI = "scImei";
|
||||
this.MMI_KS_SC_USSD = "scUssd";
|
||||
this.MMI_KS_SC_CALL = "scCall";
|
||||
|
||||
// MMI error messages key strings.
|
||||
this.MMI_ERROR_KS_ERROR = "emMmiError";
|
||||
@ -2905,6 +2906,7 @@ this.MMI_SM_KS_CLIR_DEFAULT_ON_NEXT_CALL_ON = "smClirDefaultOnNextCallOn";
|
||||
this.MMI_SM_KS_CLIR_DEFAULT_ON_NEXT_CALL_OFF = "smClirDefaultOnNextCallOff";
|
||||
this.MMI_SM_KS_CLIR_DEFAULT_OFF_NEXT_CALL_ON = "smClirDefaultOffNextCallOn";
|
||||
this.MMI_SM_KS_CLIR_DEFAULT_OFF_NEXT_CALL_OFF = "smClirDefaultOffNextCallOff";
|
||||
this.MMI_SM_KS_CALL_CONTROL = "smCallControl";
|
||||
|
||||
// MMI Service class
|
||||
this.MMI_KS_SERVICE_CLASS_VOICE = "serviceClassVoice";
|
||||
|
@ -515,24 +515,59 @@ TelephonyService.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
let mmi = this._parseMMI(aNumber, this._hasCalls(aClientId));
|
||||
if (!mmi) {
|
||||
this._dialCall(aClientId,
|
||||
{ number: aNumber,
|
||||
isDialEmergency: aIsDialEmergency }, aCallback);
|
||||
} else if (this._isTemporaryCLIR(mmi)) {
|
||||
this._dialCall(aClientId,
|
||||
{ number: mmi.dialNumber,
|
||||
clirMode: this._getTemporaryCLIRMode(mmi.procedure),
|
||||
isDialEmergency: aIsDialEmergency }, aCallback);
|
||||
} else {
|
||||
// Reject MMI code from dialEmergency api.
|
||||
if (aIsDialEmergency) {
|
||||
aCallback.notifyError(DIAL_ERROR_BAD_NUMBER);
|
||||
return;
|
||||
}
|
||||
if (this._hasCalls(aClientId)) {
|
||||
// 3GPP TS 22.030 6.5.5
|
||||
// Handling of supplementary services within a call.
|
||||
|
||||
this._dialMMI(aClientId, mmi, aCallback, true);
|
||||
let mmiCallback = response => {
|
||||
aCallback.notifyDialMMI(RIL.MMI_KS_SC_CALL);
|
||||
if (!response.success) {
|
||||
aCallback.notifyDialMMIError(RIL.MMI_ERROR_KS_ERROR);
|
||||
} else {
|
||||
aCallback.notifyDialMMISuccess(RIL.MMI_SM_KS_CALL_CONTROL);
|
||||
}
|
||||
};
|
||||
|
||||
if (aNumber === "0") {
|
||||
this._sendToRilWorker(aClientId, "hangUpBackground", null, mmiCallback);
|
||||
} else if (aNumber === "1") {
|
||||
this._sendToRilWorker(aClientId, "hangUpForeground", null, mmiCallback);
|
||||
} else if (aNumber[0] === "1" && aNumber.length === 2) {
|
||||
this._sendToRilWorker(aClientId, "hangUp",
|
||||
{ callIndex: parseInt(aNumber[1]) }, mmiCallback);
|
||||
} else if (aNumber === "2") {
|
||||
this._sendToRilWorker(aClientId, "switchActiveCall", null, mmiCallback);
|
||||
} else if (aNumber[0] === "2" && aNumber.length === 2) {
|
||||
this._sendToRilWorker(aClientId, "separateCall",
|
||||
{ callIndex: parseInt(aNumber[1]) }, mmiCallback);
|
||||
} else if (aNumber === "3") {
|
||||
this._sendToRilWorker(aClientId, "conferenceCall", null, mmiCallback);
|
||||
} else {
|
||||
// Entering "Directory Number"
|
||||
this._dialCall(aClientId,
|
||||
{ number: aNumber,
|
||||
isDialEmergency: aIsDialEmergency }, aCallback);
|
||||
}
|
||||
} else {
|
||||
let mmi = this._parseMMI(aNumber);
|
||||
if (!mmi) {
|
||||
this._dialCall(aClientId,
|
||||
{ number: aNumber,
|
||||
isDialEmergency: aIsDialEmergency }, aCallback);
|
||||
} else if (this._isTemporaryCLIR(mmi)) {
|
||||
this._dialCall(aClientId,
|
||||
{ number: mmi.dialNumber,
|
||||
clirMode: this._getTemporaryCLIRMode(mmi.procedure),
|
||||
isDialEmergency: aIsDialEmergency }, aCallback);
|
||||
} else {
|
||||
// Reject MMI code from dialEmergency api.
|
||||
if (aIsDialEmergency) {
|
||||
aCallback.notifyError(DIAL_ERROR_BAD_NUMBER);
|
||||
return;
|
||||
}
|
||||
|
||||
this._dialMMI(aClientId, mmi, aCallback, true);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -682,7 +717,7 @@ TelephonyService.prototype = {
|
||||
}
|
||||
|
||||
// No additional information
|
||||
if (response.additionalInformation == undefined) {
|
||||
if (response.additionalInformation === undefined) {
|
||||
aCallback.notifyDialMMISuccess(response.statusMessage);
|
||||
return;
|
||||
}
|
||||
@ -791,15 +826,11 @@ TelephonyService.prototype = {
|
||||
/**
|
||||
* Helper to parse short string. TS.22.030 Figure 3.5.3.2.
|
||||
*/
|
||||
_isShortString: function(aMmiString, hasCalls) {
|
||||
_isShortString: function(aMmiString) {
|
||||
if (aMmiString.length > 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hasCalls) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Input string is
|
||||
// - emergency number or
|
||||
// - 2 digits starting with a "1"
|
||||
@ -814,7 +845,7 @@ TelephonyService.prototype = {
|
||||
/**
|
||||
* Helper to parse MMI/USSD string. TS.22.030 Figure 3.5.3.2.
|
||||
*/
|
||||
_parseMMI: function(aMmiString, hasCalls) {
|
||||
_parseMMI: function(aMmiString) {
|
||||
if (!aMmiString) {
|
||||
return null;
|
||||
}
|
||||
@ -833,8 +864,7 @@ TelephonyService.prototype = {
|
||||
};
|
||||
}
|
||||
|
||||
if (this._isPoundString(aMmiString) ||
|
||||
this._isShortString(aMmiString, hasCalls)) {
|
||||
if (this._isPoundString(aMmiString) || this._isShortString(aMmiString)) {
|
||||
return {
|
||||
fullMMI: aMmiString
|
||||
};
|
||||
|
@ -12,7 +12,7 @@ function run_test() {
|
||||
}
|
||||
|
||||
function parseMMI(mmiString) {
|
||||
return NS.TelephonyService.prototype._parseMMI(mmiString, false);
|
||||
return NS.TelephonyService.prototype._parseMMI(mmiString);
|
||||
}
|
||||
|
||||
add_test(function test_parseMMI_empty() {
|
||||
|
Loading…
Reference in New Issue
Block a user