mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1239906 - Deprecate nsIRadioInterfaceLayer.getClientIdForEmergencyCall(). r=bevis
This commit is contained in:
parent
5043c59032
commit
782fe3dd3f
@ -455,18 +455,6 @@ RadioInterfaceLayer.prototype = {
|
||||
return this.radioInterfaces[clientId];
|
||||
},
|
||||
|
||||
getClientIdForEmergencyCall: function() {
|
||||
// Select the client with sim card first.
|
||||
for (let cid = 0; cid < this.numRadioInterfaces; ++cid) {
|
||||
if (this.getRadioInterface(cid).isCardPresent()) {
|
||||
return cid;
|
||||
}
|
||||
}
|
||||
|
||||
// Use the defualt client if no card presents.
|
||||
return HW_DEFAULT_CLIENT_ID;
|
||||
},
|
||||
|
||||
setMicrophoneMuted: function(muted) {
|
||||
for (let clientId = 0; clientId < this.numRadioInterfaces; clientId++) {
|
||||
let radioInterface = this.radioInterfaces[clientId];
|
||||
|
@ -42,19 +42,12 @@ interface nsIRadioInterface : nsISupports
|
||||
#define NS_RADIOINTERFACELAYER_CONTRACTID "@mozilla.org/ril;1"
|
||||
%}
|
||||
|
||||
[scriptable, uuid(78b65e8c-68e7-4510-9a05-65bba12b283e)]
|
||||
[scriptable, uuid(09730e0d-75bb-4f21-8540-062a2eadc8ff)]
|
||||
interface nsIRadioInterfaceLayer : nsISupports
|
||||
{
|
||||
readonly attribute unsigned long numRadioInterfaces;
|
||||
|
||||
nsIRadioInterface getRadioInterface(in unsigned long clientId);
|
||||
|
||||
/**
|
||||
* Select a proper client for dialing emergency call.
|
||||
*
|
||||
* @return clientId or -1 if none of the clients are avaialble.
|
||||
*/
|
||||
unsigned long getClientIdForEmergencyCall();
|
||||
|
||||
void setMicrophoneMuted(in boolean muted);
|
||||
};
|
||||
|
@ -52,6 +52,8 @@ const DIAL_ERROR_RADIO_NOT_AVAILABLE = RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE;
|
||||
|
||||
const TONES_GAP_DURATION = 70;
|
||||
|
||||
const EMERGENCY_CALL_DEFAULT_CLIENT_ID = 0;
|
||||
|
||||
// Consts for MMI.
|
||||
// MMI procedure as defined in TS.22.030 6.5.2
|
||||
const MMI_PROCEDURE_ACTIVATION = "*";
|
||||
@ -721,6 +723,26 @@ TelephonyService.prototype = {
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Select a proper client for dialing emergency call.
|
||||
*
|
||||
* @return clientId
|
||||
*/
|
||||
_getClientIdForEmergencyCall: function() {
|
||||
// Select the client with sim card first.
|
||||
for (let cid = 0; cid < this._numClients; ++cid) {
|
||||
let icc = gIccService.getIccByServiceId(cid);
|
||||
let cardState = icc ? icc.cardState : Ci.nsIIcc.CARD_STATE_UNKONWN;
|
||||
if (cardState !== Ci.nsIIcc.CARD_STATE_UNDETECTED &&
|
||||
cardState !== Ci.nsIIcc.CARD_STATE_UNKNOWN) {
|
||||
return cid;
|
||||
}
|
||||
}
|
||||
|
||||
// Use the defualt client if no card presents.
|
||||
return EMERGENCY_CALL_DEFAULT_CLIENT_ID;
|
||||
},
|
||||
|
||||
/**
|
||||
* Dial number. Perform call setup or SS procedure accordingly.
|
||||
*
|
||||
@ -866,7 +888,7 @@ TelephonyService.prototype = {
|
||||
|
||||
if (isEmergency) {
|
||||
// Automatically select a proper clientId for emergency call.
|
||||
aClientId = gRadioInterfaceLayer.getClientIdForEmergencyCall() ;
|
||||
aClientId = this._getClientIdForEmergencyCall() ;
|
||||
if (aClientId === -1) {
|
||||
if (DEBUG) debug("Error: No client is avaialble for emergency call.");
|
||||
aCallback.notifyError(DIAL_ERROR_INVALID_STATE_ERROR);
|
||||
|
Loading…
x
Reference in New Issue
Block a user