Backout e7a4fe2d9e5e (Bug 818353) due to causing bug 929815.
authorDave Hylands <dhylands@mozilla.com>
Tue, 22 Oct 2013 21:12:04 -0700
changeset 166542 4c7a2feefb4abf7840db6549efb841c46e00da68
parent 166541 78f2fa585ce782c3a07050aab5473f7f20c1bd01
child 166543 828da5ad11d85506cc65de1df28877081acb0e15
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs818353, 929815
milestone27.0a1
backs oute7a4fe2d9e5ecc0d629e2d0831d83b5b808feb9b
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout e7a4fe2d9e5e (Bug 818353) due to causing bug 929815.
dom/system/gonk/RILContentHelper.js
dom/system/gonk/RadioInterfaceLayer.js
--- a/dom/system/gonk/RILContentHelper.js
+++ b/dom/system/gonk/RILContentHelper.js
@@ -83,23 +83,23 @@ const RIL_IPC_MSG_NAMES = [
   "RIL:CardLockResult",
   "RIL:CardLockRetryCount",
   "RIL:USSDReceived",
   "RIL:SendMMI",
   "RIL:CancelMMI",
   "RIL:StkCommand",
   "RIL:StkSessionEnd",
   "RIL:DataError",
-  "RIL:SetCallForwardingOptions",
-  "RIL:GetCallForwardingOptions",
-  "RIL:SetCallBarringOptions",
-  "RIL:GetCallBarringOptions",
+  "RIL:SetCallForwardingOption",
+  "RIL:GetCallForwardingOption",
+  "RIL:SetCallBarringOption",
+  "RIL:GetCallBarringOption",
   "RIL:ChangeCallBarringPassword",
-  "RIL:SetCallWaitingOptions",
-  "RIL:GetCallWaitingOptions",
+  "RIL:SetCallWaitingOption",
+  "RIL:GetCallWaitingOption",
   "RIL:SetCallingLineIdRestriction",
   "RIL:GetCallingLineIdRestriction",
   "RIL:CellBroadcastReceived",
   "RIL:CfStateChanged",
   "RIL:IccOpenChannel",
   "RIL:IccCloseChannel",
   "RIL:IccExchangeAPDU",
   "RIL:ReadIccContacts",
@@ -379,23 +379,23 @@ CellBroadcastEtwsInfo.prototype = {
 
   // nsIDOMMozCellBroadcastEtwsInfo
 
   warningType: null,
   emergencyUserAlert: null,
   popup: null
 };
 
-function CallBarringOptions(options) {
-  this.program = options.program;
-  this.enabled = options.enabled;
-  this.password = options.password;
-  this.serviceClass = options.serviceClass;
+function CallBarringOption(option) {
+  this.program = option.program;
+  this.enabled = option.enabled;
+  this.password = option.password;
+  this.serviceClass = option.serviceClass;
 }
-CallBarringOptions.prototype = {
+CallBarringOption.prototype = {
   __exposedProps__ : {program: 'r',
                       enabled: 'r',
                       password: 'r',
                       serviceClass: 'r'}
 };
 
 function DOMMMIResult(result) {
   this.serviceCode = result.serviceCode;
@@ -444,40 +444,27 @@ IccCardLockError.prototype = {
   __init: function(lockType, errorMsg, retryCount) {
     this.__DOM_IMPL__.init(errorMsg);
     this.lockType = lockType;
     this.retryCount = retryCount;
   },
 };
 
 function RILContentHelper() {
-
-  this.numClients = gNumRadioInterfaces;
-  debug("Number of clients: " + this.numClients);
-
-  this.rilContexts = [];
-  for (let clientId = 0; clientId < this.numClients; clientId++) {
-    this.rilContexts[clientId] = {
-      cardState:            RIL.GECKO_CARDSTATE_UNKNOWN,
-      networkSelectionMode: RIL.GECKO_NETWORK_SELECTION_UNKNOWN,
-      iccInfo:              null,
-      voiceConnectionInfo:  new MobileConnectionInfo(),
-      dataConnectionInfo:   new MobileConnectionInfo()
-    };
-  }
+  this.rilContext = {
+    cardState:            RIL.GECKO_CARDSTATE_UNKNOWN,
+    networkSelectionMode: RIL.GECKO_NETWORK_SELECTION_UNKNOWN,
+    iccInfo:              null,
+    voiceConnectionInfo:  new MobileConnectionInfo(),
+    dataConnectionInfo:   new MobileConnectionInfo()
+  };
   this.voicemailInfo = new VoicemailInfo();
 
   this.initDOMRequestHelper(/* aWindow */ null, RIL_IPC_MSG_NAMES);
   this._windowsMap = [];
-  this._selectingNetworks = [];
-  this._mobileConnectionListeners = [];
-  this._cellBroadcastListeners = [];
-  this._voicemailListeners = [];
-  this._iccListeners = [];
-
   Services.obs.addObserver(this, "xpcom-shutdown", false);
 }
 
 RILContentHelper.prototype = {
   __proto__: DOMRequestIpcHelper.prototype,
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIMobileConnectionProvider,
                                          Ci.nsICellBroadcastProvider,
@@ -533,138 +520,123 @@ RILContentHelper.prototype = {
     this.updateInfo(srcNetwork, network);
   },
 
   /**
    * We need to consider below cases when update iccInfo:
    * 1. Should clear iccInfo to null if there is no card detected.
    * 2. Need to create corresponding object based on iccType.
    */
-  updateIccInfo: function updateIccInfo(clientId, newInfo) {
-    let rilContext = this.rilContexts[clientId];
-
+  updateIccInfo: function updateIccInfo(newInfo) {
     // Card is not detected, clear iccInfo to null.
     if (!newInfo || !newInfo.iccType) {
-      rilContext.iccInfo = null;
+      this.rilContext.iccInfo = null;
       return;
     }
 
     // If iccInfo is null, new corresponding object based on iccType.
-    if (!rilContext.iccInfo) {
+    if (!this.rilContext.iccInfo) {
       if (newInfo.iccType === "ruim" || newInfo.iccType === "csim") {
-        rilContext.iccInfo = new CdmaIccInfo();
+        this.rilContext.iccInfo = new CdmaIccInfo();
       } else {
-        rilContext.iccInfo = new GsmIccInfo();
+        this.rilContext.iccInfo = new GsmIccInfo();
       }
     }
 
-    this.updateInfo(newInfo, rilContext.iccInfo);
+    this.updateInfo(newInfo, this.rilContext.iccInfo);
   },
 
   _windowsMap: null,
 
-  rilContexts: null,
+  rilContext: null,
 
-  getRilContext: function getRilContext(clientId) {
-    // Update ril contexts by sending IPC message to chrome only when the first
+  getRilContext: function getRilContext() {
+    // Update ril context by sending IPC message to chrome only when the first
     // time we require it. The information will be updated by following info
     // changed messages.
-    this.getRilContext = function getRilContext(clientId) {
-      return this.rilContexts[clientId];
+    this.getRilContext = function getRilContext() {
+      return this.rilContext;
     };
 
-    for (let cId = 0; cId < this.numClients; cId++) {
-      let rilContext =
-        cpmm.sendSyncMessage("RIL:GetRilContext", {clientId: cId})[0];
-      if (!rilContext) {
-        debug("Received null rilContext from chrome process.");
-        continue;
-      }
-      this.rilContexts[cId].cardState = rilContext.cardState;
-      this.rilContexts[cId].networkSelectionMode = rilContext.networkSelectionMode;
-      this.updateIccInfo(cId, rilContext.iccInfo);
-      this.updateConnectionInfo(rilContext.voice, this.rilContexts[cId].voiceConnectionInfo);
-      this.updateConnectionInfo(rilContext.data, this.rilContexts[cId].dataConnectionInfo);
+    let rilContext =
+      cpmm.sendSyncMessage("RIL:GetRilContext", {clientId: 0})[0];
+    if (!rilContext) {
+      debug("Received null rilContext from chrome process.");
+      return;
     }
+    this.rilContext.cardState = rilContext.cardState;
+    this.rilContext.networkSelectionMode = rilContext.networkSelectionMode;
+    this.updateIccInfo(rilContext.iccInfo);
+    this.updateConnectionInfo(rilContext.voice, this.rilContext.voiceConnectionInfo);
+    this.updateConnectionInfo(rilContext.data, this.rilContext.dataConnectionInfo);
 
-    return this.rilContexts[clientId];
-  },
-
-  /**
-   * nsIIccProvider
-   */
-
-  get iccInfo() {
-    //TODO: Bug 814637 - WebIccManager API: support multiple sim cards.
-    let context = this.getRilContext(0);
-    return context && context.iccInfo;
-  },
-
-  get cardState() {
-    //TODO: Bug 814637 - WebIccManager API: support multiple sim cards.
-    let context = this.getRilContext(0);
-    return context && context.cardState;
+    return this.rilContext;
   },
 
   /**
    * nsIMobileConnectionProvider
    */
 
-  getVoiceConnectionInfo: function getVoiceConnectionInfo(clientId) {
-    let context = this.getRilContext(clientId);
+  get iccInfo() {
+    let context = this.getRilContext();
+    return context && context.iccInfo;
+  },
+
+  get voiceConnectionInfo() {
+    let context = this.getRilContext();
     return context && context.voiceConnectionInfo;
   },
 
-  getDataConnectionInfo: function getDataConnectionInfo(clientId) {
-    let context = this.getRilContext(clientId);
+  get dataConnectionInfo() {
+    let context = this.getRilContext();
     return context && context.dataConnectionInfo;
   },
 
-  getIccId: function getIccId(clientId) {
-    let context = this.getRilContext(clientId);
-    return context && context.iccInfo.iccid;
+  get cardState() {
+    let context = this.getRilContext();
+    return context && context.cardState;
   },
 
-  getNetworkSelectionMode: function getNetworkSelectionMode(clientId) {
-    let context = this.getRilContext(clientId);
+  get networkSelectionMode() {
+    let context = this.getRilContext();
     return context && context.networkSelectionMode;
   },
 
   /**
-   * The networks that are currently trying to be selected (or "automatic").
-   * This helps ensure that only one network per client is selected at a time.
+   * The network that is currently trying to be selected (or "automatic").
+   * This helps ensure that only one network is selected at a time.
    */
-  _selectingNetworks: null,
+  _selectingNetwork: null,
 
-  getNetworks: function getNetworks(clientId, window) {
+  getNetworks: function getNetworks(window) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
 
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     cpmm.sendAsyncMessage("RIL:GetAvailableNetworks", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId
       }
     });
     return request;
   },
 
-  selectNetwork: function selectNetwork(clientId, window, network) {
+  selectNetwork: function selectNetwork(window, network) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
 
-    if (this._selectingNetworks[clientId]) {
-      throw new Error("Already selecting a network: " + this._selectingNetworks[clientId]);
+    if (this._selectingNetwork) {
+      throw new Error("Already selecting a network: " + this._selectingNetwork);
     }
 
     if (!network) {
       throw new Error("Invalid network provided: " + network);
     }
 
     if (isNaN(parseInt(network.mnc, 10))) {
       throw new Error("Invalid network MNC: " + network.mnc);
@@ -672,143 +644,143 @@ RILContentHelper.prototype = {
 
     if (isNaN(parseInt(network.mcc, 10))) {
       throw new Error("Invalid network MCC: " + network.mcc);
     }
 
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
-    if (this.rilContexts[clientId].networkSelectionMode == RIL.GECKO_NETWORK_SELECTION_MANUAL &&
-        this.rilContexts[clientId].voiceConnectionInfo.network === network) {
+    if (this.rilContext.networkSelectionMode == RIL.GECKO_NETWORK_SELECTION_MANUAL &&
+        this.rilContext.voiceConnectionInfo.network === network) {
 
       // Already manually selected this network, so schedule
       // onsuccess to be fired on the next tick
       this.dispatchFireRequestSuccess(requestId, null);
       return request;
     }
 
-    this._selectingNetworks[clientId] = network;
+    this._selectingNetwork = network;
 
     cpmm.sendAsyncMessage("RIL:SelectNetwork", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId,
         mnc: network.mnc,
         mcc: network.mcc
       }
     });
 
     return request;
   },
 
-  selectNetworkAutomatically: function selectNetworkAutomatically(clientId, window) {
+  selectNetworkAutomatically: function selectNetworkAutomatically(window) {
 
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
 
-    if (this._selectingNetworks[clientId]) {
-      throw new Error("Already selecting a network: " + this._selectingNetworks[clientId]);
+    if (this._selectingNetwork) {
+      throw new Error("Already selecting a network: " + this._selectingNetwork);
     }
 
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
-    if (this.rilContexts[clientId].networkSelectionMode == RIL.GECKO_NETWORK_SELECTION_AUTOMATIC) {
+    if (this.rilContext.networkSelectionMode == RIL.GECKO_NETWORK_SELECTION_AUTOMATIC) {
       // Already using automatic selection mode, so schedule
       // onsuccess to be be fired on the next tick
       this.dispatchFireRequestSuccess(requestId, null);
       return request;
     }
 
-    this._selectingNetworks[clientId] = "automatic";
+    this._selectingNetwork = "automatic";
     cpmm.sendAsyncMessage("RIL:SelectNetworkAuto", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId
       }
     });
     return request;
   },
 
-  setRoamingPreference: function setRoamingPreference(clientId, window, mode) {
+  setRoamingPreference: function setRoamingPreference(window, mode) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
 
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     if (!mode) {
       this.dispatchFireRequestError(requestId,
                                     RIL.GECKO_ERROR_INVALID_PARAMETER);
       return request;
     }
 
     cpmm.sendAsyncMessage("RIL:SetRoamingPreference", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId,
         mode: mode
       }
     });
     return request;
   },
 
-  getRoamingPreference: function getRoamingPreference(clientId, window) {
+  getRoamingPreference: function getRoamingPreference(window) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
 
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     cpmm.sendAsyncMessage("RIL:GetRoamingPreference", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId
       }
     });
     return request;
   },
 
-  setVoicePrivacyMode: function setVoicePrivacyMode(clientId, window, enabled) {
+  setVoicePrivacyMode: function setVoicePrivacyMode(window, enabled) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
 
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     cpmm.sendAsyncMessage("RIL:SetVoicePrivacyMode", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId,
         enabled: enabled
       }
     });
     return request;
   },
 
-  getVoicePrivacyMode: function getVoicePrivacyMode(clientId, window) {
+  getVoicePrivacyMode: function getVoicePrivacyMode(window) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
 
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     cpmm.sendAsyncMessage("RIL:GetVoicePrivacyMode", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId
       }
     });
     return request;
   },
 
   getCardLockState: function getCardLockState(window, lockType) {
@@ -874,48 +846,48 @@ RILContentHelper.prototype = {
       data: {
         lockType: lockType,
         requestId: requestId
       }
     });
     return request;
   },
 
-  sendMMI: function sendMMI(clientId, window, mmi) {
+  sendMMI: function sendMMI(window, mmi) {
     debug("Sending MMI " + mmi);
     if (!window) {
       throw Components.Exception("Can't get window object",
                                  Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
     // We need to save the global window to get the proper MMIError
     // constructor once we get the reply from the parent process.
     this._windowsMap[requestId] = window;
 
     cpmm.sendAsyncMessage("RIL:SendMMI", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         mmi: mmi,
         requestId: requestId
       }
     });
     return request;
   },
 
-  cancelMMI: function cancelMMI(clientId, window) {
+  cancelMMI: function cancelMMI(window) {
     debug("Cancel MMI");
     if (!window) {
       throw Components.Exception("Can't get window object",
                                  Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
     cpmm.sendAsyncMessage("RIL:CancelMMI", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId
       }
     });
     return request;
   },
 
   sendStkResponse: function sendStkResponse(window, command, response) {
@@ -1099,128 +1071,128 @@ RILContentHelper.prototype = {
         contact: iccContact,
         pin2: pin2
       }
     });
 
     return request;
   },
 
-  getCallForwardingOption: function getCallForwardingOption(clientId, window, reason) {
+  getCallForwardingOption: function getCallForwardingOption(window, reason) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     if (!this._isValidCFReason(reason)){
       this.dispatchFireRequestError(requestId,
                                     RIL.GECKO_ERROR_INVALID_PARAMETER);
       return request;
     }
 
-    cpmm.sendAsyncMessage("RIL:GetCallForwardingOptions", {
-      clientId: clientId,
+    cpmm.sendAsyncMessage("RIL:GetCallForwardingOption", {
+      clientId: 0,
       data: {
         requestId: requestId,
         reason: reason
       }
     });
 
     return request;
   },
 
-  setCallForwardingOption: function setCallForwardingOption(clientId, window, cfInfo) {
+  setCallForwardingOption: function setCallForwardingOption(window, cfInfo) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     if (!cfInfo ||
         !this._isValidCFReason(cfInfo.reason) ||
         !this._isValidCFAction(cfInfo.action)){
       this.dispatchFireRequestError(requestId,
                                     RIL.GECKO_ERROR_INVALID_PARAMETER);
       return request;
     }
 
-    cpmm.sendAsyncMessage("RIL:SetCallForwardingOptions", {
-      clientId: clientId,
+    cpmm.sendAsyncMessage("RIL:SetCallForwardingOption", {
+      clientId: 0,
       data: {
         requestId: requestId,
         active: cfInfo.active,
         action: cfInfo.action,
         reason: cfInfo.reason,
         number: cfInfo.number,
         timeSeconds: cfInfo.timeSeconds
       }
     });
 
     return request;
   },
 
-  getCallBarringOption: function getCallBarringOption(clientId, window, option) {
+  getCallBarringOption: function getCallBarringOption(window, option) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     if (DEBUG) debug("getCallBarringOption: " + JSON.stringify(option));
-    if (!this._isValidCallBarringOptions(option)) {
+    if (!this._isValidCallBarringOption(option)) {
       this.dispatchFireRequestError(requestId,
                                     RIL.GECKO_ERROR_INVALID_PARAMETER);
       return request;
     }
 
-    cpmm.sendAsyncMessage("RIL:GetCallBarringOptions", {
-      clientId: clientId,
+    cpmm.sendAsyncMessage("RIL:GetCallBarringOption", {
+      clientId: 0,
       data: {
         requestId: requestId,
         program: option.program,
         password: option.password,
         serviceClass: option.serviceClass
       }
     });
     return request;
   },
 
-  setCallBarringOption: function setCallBarringOption(clientId, window, option) {
+  setCallBarringOption: function setCallBarringOption(window, option) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     if (DEBUG) debug("setCallBarringOption: " + JSON.stringify(option));
-    if (!this._isValidCallBarringOptions(option, true)) {
+    if (!this._isValidCallBarringOption(option, true)) {
       this.dispatchFireRequestError(requestId,
                                     RIL.GECKO_ERROR_INVALID_PARAMETER);
       return request;
     }
 
-    cpmm.sendAsyncMessage("RIL:SetCallBarringOptions", {
-      clientId: clientId,
+    cpmm.sendAsyncMessage("RIL:SetCallBarringOption", {
+      clientId: 0,
       data: {
         requestId: requestId,
         program: option.program,
         enabled: option.enabled,
         password: option.password,
         serviceClass: option.serviceClass
       }
     });
     return request;
   },
 
-  changeCallBarringPassword: function changeCallBarringPassword(clientId, window, info) {
+  changeCallBarringPassword: function changeCallBarringPassword(window, info) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     // Checking valid PIN for supplementary services. See TS.22.004 clause 5.2.
@@ -1228,109 +1200,109 @@ RILContentHelper.prototype = {
         info.newPin == null || !info.newPin.match(/^\d{4}$/)) {
       this.dispatchFireRequestError(requestId, "InvalidPassword");
       return request;
     }
 
     if (DEBUG) debug("changeCallBarringPassword: " + JSON.stringify(info));
     info.requestId = requestId;
     cpmm.sendAsyncMessage("RIL:ChangeCallBarringPassword", {
-      clientId: clientId,
+      clientId: 0,
       data: info
     });
 
     return request;
   },
 
-  getCallWaitingOption: function getCallWaitingOption(clientId, window) {
+  getCallWaitingOption: function getCallWaitingOption(window) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
-    cpmm.sendAsyncMessage("RIL:GetCallWaitingOptions", {
-      clientId: clientId,
+    cpmm.sendAsyncMessage("RIL:GetCallWaitingOption", {
+      clientId: 0,
       data: {
         requestId: requestId
       }
     });
 
     return request;
   },
 
-  setCallWaitingOption: function setCallWaitingOption(clientId, window, enabled) {
+  setCallWaitingOption: function setCallWaitingOption(window, enabled) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
-    cpmm.sendAsyncMessage("RIL:SetCallWaitingOptions", {
-      clientId: clientId,
+    cpmm.sendAsyncMessage("RIL:SetCallWaitingOption", {
+      clientId: 0,
       data: {
         requestId: requestId,
         enabled: enabled
       }
     });
 
     return request;
   },
 
-  getCallingLineIdRestriction: function getCallingLineIdRestriction(clientId, window) {
+  getCallingLineIdRestriction: function getCallingLineIdRestriction(window) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     cpmm.sendAsyncMessage("RIL:GetCallingLineIdRestriction", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId
       }
     });
 
     return request;
   },
 
   setCallingLineIdRestriction:
-    function setCallingLineIdRestriction(clientId, window, clirMode) {
+    function setCallingLineIdRestriction(window, clirMode) {
 
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     cpmm.sendAsyncMessage("RIL:SetCallingLineIdRestriction", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId,
         clirMode: clirMode
       }
     });
 
     return request;
   },
 
-  exitEmergencyCbMode: function exitEmergencyCbMode(clientId, window) {
+  exitEmergencyCbMode: function exitEmergencyCbMode(window) {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     let requestId = this.getRequestId(request);
 
     cpmm.sendAsyncMessage("RIL:ExitEmergencyCbMode", {
-      clientId: clientId,
+      clientId: 0,
       data: {
         requestId: requestId,
       }
     });
 
     return request;
   },
 
@@ -1357,93 +1329,81 @@ RILContentHelper.prototype = {
   },
   get voicemailNumber() {
     return this.getVoicemailInfo().number;
   },
   get voicemailDisplayName() {
     return this.getVoicemailInfo().displayName;
   },
 
-  registerListener: function registerListener(listenerType, clientId, listener) {
-    if (!this[listenerType]) {
-      return;
-    }
-    let listeners = this[listenerType][clientId];
+  registerListener: function registerListener(listenerType, listener) {
+    let listeners = this[listenerType];
     if (!listeners) {
-      listeners = this[listenerType][clientId] = [];
+      listeners = this[listenerType] = [];
     }
 
     if (listeners.indexOf(listener) != -1) {
       throw new Error("Already registered this listener!");
     }
 
     listeners.push(listener);
     if (DEBUG) debug("Registered " + listenerType + " listener: " + listener);
   },
 
-  unregisterListener: function unregisterListener(listenerType, clientId, listener) {
-    if (!this[listenerType]) {
-      return;
-    }
-    let listeners = this[listenerType][clientId];
+  unregisterListener: function unregisterListener(listenerType, listener) {
+    let listeners = this[listenerType];
     if (!listeners) {
       return;
     }
 
     let index = listeners.indexOf(listener);
     if (index != -1) {
       listeners.splice(index, 1);
       if (DEBUG) debug("Unregistered listener: " + listener);
     }
   },
 
-  registerMobileConnectionMsg: function registerMobileConnectionMsg(clientId, listener) {
+  registerMobileConnectionMsg: function registerMobileConnectionMsg(listener) {
     debug("Registering for mobile connection related messages");
-    this.registerListener("_mobileConnectionListeners", clientId, listener);
+    this.registerListener("_mobileConnectionListeners", listener);
     cpmm.sendAsyncMessage("RIL:RegisterMobileConnectionMsg");
   },
 
-  unregisterMobileConnectionMsg: function unregisteMobileConnectionMsg(clientId, listener) {
-    this.unregisterListener("_mobileConnectionListeners", clientId, listener);
+  unregisterMobileConnectionMsg: function unregisteMobileConnectionMsg(listener) {
+    this.unregisterListener("_mobileConnectionListeners", listener);
   },
 
   registerVoicemailMsg: function registerVoicemailMsg(listener) {
     debug("Registering for voicemail-related messages");
-    //TODO: Bug 814634 - WebVoicemail API: support multiple sim cards.
-    this.registerListener("_voicemailListeners", 0, listener);
+    this.registerListener("_voicemailListeners", listener);
     cpmm.sendAsyncMessage("RIL:RegisterVoicemailMsg");
   },
 
   unregisterVoicemailMsg: function unregisteVoicemailMsg(listener) {
-    //TODO: Bug 814634 - WebVoicemail API: support multiple sim cards.
-    this.unregisterListener("_voicemailListeners", 0, listener);
+    this.unregisterListener("_voicemailListeners", listener);
   },
 
   registerCellBroadcastMsg: function registerCellBroadcastMsg(listener) {
     debug("Registering for Cell Broadcast related messages");
-    //TODO: Bug 921326 - Cellbroadcast API: support multiple sim cards
-    this.registerListener("_cellBroadcastListeners", 0, listener);
+    this.registerListener("_cellBroadcastListeners", listener);
     cpmm.sendAsyncMessage("RIL:RegisterCellBroadcastMsg");
   },
 
   unregisterCellBroadcastMsg: function unregisterCellBroadcastMsg(listener) {
-    //TODO: Bug 921326 - Cellbroadcast API: support multiple sim cards
-    this.unregisterListener("_cellBroadcastListeners", 0, listener);
+    this.unregisterListener("_cellBroadcastListeners", listener);
   },
 
   registerIccMsg: function registerIccMsg(listener) {
     debug("Registering for ICC related messages");
-    //TODO: Bug 814637 - WebIccManager API: support multiple sim cards.
-    this.registerListener("_iccListeners", 0, listener);
+    this.registerListener("_iccListeners", listener);
     cpmm.sendAsyncMessage("RIL:RegisterIccMsg");
   },
 
   unregisterIccMsg: function unregisterIccMsg(listener) {
-    //TODO: Bug 814637 - WebIccManager API: support multiple sim cards.
-    this.unregisterListener("_iccListeners", 0, listener);
+    this.unregisterListener("_iccListeners", listener);
   },
 
   // nsIObserver
 
   observe: function observe(subject, topic, data) {
     if (topic == "xpcom-shutdown") {
       this.destroyDOMRequestHelper();
       Services.obs.removeObserver(this, "xpcom-shutdown");
@@ -1513,72 +1473,64 @@ RILContentHelper.prototype = {
     Services.DOMRequest.fireDetailedError(request, detailedError);
   },
 
   receiveMessage: function receiveMessage(msg) {
     let request;
     debug("Received message '" + msg.name + "': " + JSON.stringify(msg.json));
 
     let data = msg.json.data;
-    let clientId = msg.json.clientId;
     switch (msg.name) {
       case "RIL:CardStateChanged":
-        if (this.rilContexts[clientId].cardState != data.cardState) {
-          this.rilContexts[clientId].cardState = data.cardState;
-          this._deliverEvent(clientId,
-                             "_iccListeners",
+        if (this.rilContext.cardState != data.cardState) {
+          this.rilContext.cardState = data.cardState;
+          this._deliverEvent("_iccListeners",
                              "notifyCardStateChanged",
                              null);
         }
         break;
       case "RIL:IccInfoChanged":
-        this.updateIccInfo(clientId, data);
-        this._deliverEvent(clientId,
-                           "_iccListeners",
-                           "notifyIccInfoChanged",
-                           null);
+        this.updateIccInfo(data);
+        this._deliverEvent("_iccListeners", "notifyIccInfoChanged", null);
         break;
       case "RIL:VoiceInfoChanged":
         this.updateConnectionInfo(data,
-                                  this.rilContexts[clientId].voiceConnectionInfo);
-        this._deliverEvent(clientId,
-                           "_mobileConnectionListeners",
+                                  this.rilContext.voiceConnectionInfo);
+        this._deliverEvent("_mobileConnectionListeners",
                            "notifyVoiceChanged",
                            null);
         break;
       case "RIL:DataInfoChanged":
         this.updateConnectionInfo(data,
-                                  this.rilContexts[clientId].dataConnectionInfo);
-        this._deliverEvent(clientId,
-                           "_mobileConnectionListeners",
+                                  this.rilContext.dataConnectionInfo);
+        this._deliverEvent("_mobileConnectionListeners",
                            "notifyDataChanged",
                            null);
         break;
       case "RIL:OtaStatusChanged":
-        this._deliverEvent(clientId,
-                           "_mobileConnectionListeners",
+        this._deliverEvent("_mobileConnectionListeners",
                            "notifyOtaStatusChanged",
                            [data]);
         break;
       case "RIL:GetAvailableNetworks":
         this.handleGetAvailableNetworks(data);
         break;
       case "RIL:NetworkSelectionModeChanged":
-        this.rilContexts[clientId].networkSelectionMode = data.mode;
+        this.rilContext.networkSelectionMode = data.mode;
         break;
       case "RIL:SelectNetwork":
-        this.handleSelectNetwork(clientId, data,
+        this.handleSelectNetwork(data,
                                  RIL.GECKO_NETWORK_SELECTION_MANUAL);
         break;
       case "RIL:SelectNetworkAuto":
-        this.handleSelectNetwork(clientId, data,
+        this.handleSelectNetwork(data,
                                  RIL.GECKO_NETWORK_SELECTION_AUTOMATIC);
         break;
       case "RIL:VoicemailNotification":
-        this.handleVoicemailNotification(clientId, data);
+        this.handleVoicemailNotification(data);
         break;
       case "RIL:VoicemailInfoChanged":
         this.updateInfo(data, this.voicemailInfo);
         break;
       case "RIL:CardLockResult": {
         let requestId = data.requestId;
         let requestWindow = this._windowsMap[requestId];
         delete this._windowsMap[requestId];
@@ -1603,31 +1555,30 @@ RILContentHelper.prototype = {
         if (data.success) {
           let result = new MobileIccCardLockRetryCount(data);
           this.fireRequestSuccess(data.requestId, result);
         } else {
           this.fireRequestError(data.requestId, data.errorMsg);
         }
         break;
       case "RIL:USSDReceived":
-        this._deliverEvent(clientId,
-                           "_mobileConnectionListeners",
+        this._deliverEvent("_mobileConnectionListeners",
                            "notifyUssdReceived",
                            [data.message, data.sessionEnded]);
         break;
       case "RIL:SendMMI":
       case "RIL:CancelMMI":
         this.handleSendCancelMMI(data);
         break;
       case "RIL:StkCommand":
-        this._deliverEvent(clientId, "_iccListeners", "notifyStkCommand",
+        this._deliverEvent("_iccListeners", "notifyStkCommand",
                            [JSON.stringify(data)]);
         break;
       case "RIL:StkSessionEnd":
-        this._deliverEvent(clientId, "_iccListeners", "notifyStkSessionEnd", null);
+        this._deliverEvent("_iccListeners", "notifyStkSessionEnd", null);
         break;
       case "RIL:IccOpenChannel":
         this.handleSimpleRequest(data.requestId, data.errorMsg,
                                  data.channel);
         break;
       case "RIL:IccCloseChannel":
         this.handleSimpleRequest(data.requestId, data.errorMsg, null);
         break;
@@ -1636,77 +1587,74 @@ RILContentHelper.prototype = {
         break;
       case "RIL:ReadIccContacts":
         this.handleReadIccContacts(data);
         break;
       case "RIL:UpdateIccContact":
         this.handleSimpleRequest(data.requestId, data.errorMsg, null);
         break;
       case "RIL:DataError":
-        this.updateConnectionInfo(data, this.rilContexts[clientId].dataConnectionInfo);
-        this._deliverEvent(clientId, "_mobileConnectionListeners", "notifyDataError",
+        this.updateConnectionInfo(data, this.rilContext.dataConnectionInfo);
+        this._deliverEvent("_mobileConnectionListeners", "notifyDataError",
                            [data.errorMsg]);
         break;
-      case "RIL:GetCallForwardingOptions":
-        this.handleGetCallForwardingOptions(data);
+      case "RIL:GetCallForwardingOption":
+        this.handleGetCallForwardingOption(data);
         break;
-      case "RIL:SetCallForwardingOptions":
+      case "RIL:SetCallForwardingOption":
         this.handleSimpleRequest(data.requestId, data.errorMsg, null);
         break;
-      case "RIL:GetCallBarringOptions":
-        this.handleGetCallBarringOptions(data);
+      case "RIL:GetCallBarringOption":
+        this.handleGetCallBarringOption(data);
         break;
-      case "RIL:SetCallBarringOptions":
+      case "RIL:SetCallBarringOption":
         this.handleSimpleRequest(data.requestId, data.errorMsg, null);
         break;
       case "RIL:ChangeCallBarringPassword":
         this.handleSimpleRequest(data.requestId, data.errorMsg, null);
         break;
-      case "RIL:GetCallWaitingOptions":
+      case "RIL:GetCallWaitingOption":
         this.handleSimpleRequest(data.requestId, data.errorMsg,
                                  data.enabled);
         break;
-      case "RIL:SetCallWaitingOptions":
+      case "RIL:SetCallWaitingOption":
         this.handleSimpleRequest(data.requestId, data.errorMsg, null);
         break;
       case "RIL:CfStateChanged":
-        this._deliverEvent(clientId,
-                           "_mobileConnectionListeners",
+        this._deliverEvent("_mobileConnectionListeners",
                            "notifyCFStateChange",
                            [data.success, data.action,
                             data.reason, data.number,
                             data.timeSeconds, data.serviceClass]);
         break;
       case "RIL:GetCallingLineIdRestriction":
         this.handleGetCallingLineIdRestriction(data);
         break;
       case "RIL:SetCallingLineIdRestriction":
         this.handleSimpleRequest(data.requestId, data.errorMsg, null);
         break;
       case "RIL:CellBroadcastReceived": {
         let message = new CellBroadcastMessage(data);
-        this._deliverEvent(clientId,
-                           "_cellBroadcastListeners",
+        this._deliverEvent("_cellBroadcastListeners",
                            "notifyMessageReceived",
                            [message]);
         break;
       }
       case "RIL:SetRoamingPreference":
         this.handleSimpleRequest(data.requestId, data.errorMsg, null);
         break;
       case "RIL:GetRoamingPreference":
         this.handleSimpleRequest(data.requestId, data.errorMsg,
                                  data.mode);
         break;
       case "RIL:ExitEmergencyCbMode":
         this.handleExitEmergencyCbMode(data);
         break;
       case "RIL:EmergencyCbModeChanged":
-        this._deliverEvent(clientId,
-                           "_mobileConnectionListeners",
+        this._deliverEvent("_mobileConnectionListeners",
                            "notifyEmergencyCbModeChanged",
                            [data.active, data.timeoutMs]);
         break;
       case "RIL:SetVoicePrivacyMode":
         this.handleSimpleRequest(data.requestId, data.errorMsg, null);
         break;
       case "RIL:GetVoicePrivacyMode":
         this.handleSimpleRequest(data.requestId, data.errorMsg,
@@ -1737,19 +1685,19 @@ RILContentHelper.prototype = {
       let info = new MobileNetworkInfo();
       this.updateInfo(network, info);
       networks[i] = info;
     }
 
     this.fireRequestSuccess(message.requestId, networks);
   },
 
-  handleSelectNetwork: function handleSelectNetwork(clientId, message, mode) {
-    this._selectingNetworks[clientId] = null;
-    this.rilContexts[clientId].networkSelectionMode = mode;
+  handleSelectNetwork: function handleSelectNetwork(message, mode) {
+    this._selectingNetwork = null;
+    this.rilContext.networkSelectionMode = mode;
 
     if (message.errorMsg) {
       this.fireRequestError(message.requestId, message.errorMsg);
     } else {
       this.fireRequestSuccess(message.requestId, null);
     }
   },
 
@@ -1788,18 +1736,17 @@ RILContentHelper.prototype = {
       contact.id = message.iccid + c.recordId;
       return contact;
     });
 
     this.fireRequestSuccess(message.requestId,
                             ObjectWrapper.wrap(result, window));
   },
 
-  handleVoicemailNotification: function handleVoicemailNotification(clientId, message) {
-    // TODO: Bug 818352 - B2G Multi-SIM: voicemail - add subscription id in nsIRILContentHelper
+  handleVoicemailNotification: function handleVoicemailNotification(message) {
     let changed = false;
     if (!this.voicemailStatus) {
       this.voicemailStatus = new VoicemailStatus();
     }
 
     if (this.voicemailStatus.hasMessages != message.active) {
       changed = true;
       this.voicemailStatus.hasMessages = message.active;
@@ -1819,48 +1766,47 @@ RILContentHelper.prototype = {
     }
 
     if (this.voicemailStatus.returnMessage != message.returnMessage) {
       changed = true;
       this.voicemailStatus.returnMessage = message.returnMessage;
     }
 
     if (changed) {
-      this._deliverEvent(clientId,
-                         "_voicemailListeners",
+      this._deliverEvent("_voicemailListeners",
                          "notifyStatusChanged",
                          [this.voicemailStatus]);
     }
   },
 
   _cfRulesToMobileCfInfo: function _cfRulesToMobileCfInfo(rules) {
     for (let i = 0; i < rules.length; i++) {
       let rule = rules[i];
       let info = new MobileCFInfo();
       this.updateInfo(rule, info);
       rules[i] = info;
     }
   },
 
-  handleGetCallForwardingOptions: function handleGetCallForwardingOptions(message) {
+  handleGetCallForwardingOption: function handleGetCallForwardingOption(message) {
     if (message.errorMsg) {
       this.fireRequestError(message.requestId, message.errorMsg);
       return;
     }
 
     this._cfRulesToMobileCfInfo(message.rules);
     this.fireRequestSuccess(message.requestId, message.rules);
   },
 
-  handleGetCallBarringOptions: function handleGetCallBarringOptions(message) {
+  handleGetCallBarringOption: function handleGetCallBarringOption(message) {
     if (!message.success) {
       this.fireRequestError(message.requestId, message.errorMsg);
     } else {
-      let options = new CallBarringOptions(message);
-      this.fireRequestSuccess(message.requestId, options);
+      let option = new CallBarringOption(message);
+      this.fireRequestSuccess(message.requestId, option);
     }
   },
 
   handleGetCallingLineIdRestriction:
     function handleGetCallingLineIdRestriction(message) {
     if (message.errorMsg) {
       this.fireRequestError(message.requestId, message.errorMsg);
       return;
@@ -1926,21 +1872,18 @@ RILContentHelper.prototype = {
       let mmiError = new requestWindow.DOMMMIError(result.serviceCode,
                                                    message.errorMsg,
                                                    null,
                                                    result.additionalInformation);
       Services.DOMRequest.fireDetailedError(request, mmiError);
     }
   },
 
-  _deliverEvent: function _deliverEvent(clientId, listenerType, name, args) {
-    if (!this[listenerType]) {
-      return;
-    }
-    let thisListeners = this[listenerType][clientId];
+  _deliverEvent: function _deliverEvent(listenerType, name, args) {
+    let thisListeners = this[listenerType];
     if (!thisListeners) {
       return;
     }
 
     let listeners = thisListeners.slice();
     for (let listener of listeners) {
       if (thisListeners.indexOf(listener) == -1) {
         continue;
@@ -2001,28 +1944,28 @@ RILContentHelper.prototype = {
       case Ci.nsIDOMMozMobileConnection.CALL_BARRING_PROGRAM_INCOMING_ROAMING:
         return true;
       default:
         return false;
     }
   },
 
   /**
-   * Helper for guarding us against invalid options for call barring.
+   * Helper for guarding us against invalid option for call barring.
    */
-  _isValidCallBarringOptions:
-      function _isValidCallBarringOptions(options, usedForSetting) {
-    if (!options ||
-        options.serviceClass == null ||
-        !this._isValidCallBarringProgram(options.program)) {
+  _isValidCallBarringOption:
+      function _isValidCallBarringOption(option, usedForSetting) {
+    if (!option ||
+        option.serviceClass == null ||
+        !this._isValidCallBarringProgram(option.program)) {
       return false;
     }
 
-    // For setting callbarring options, |enabled| and |password| are required.
-    if (usedForSetting && (options.enabled == null || options.password == null)) {
+    // For setting callbarring option, |enabled| and |password| are required.
+    if (usedForSetting && (option.enabled == null || option.password == null)) {
       return false;
     }
 
     return true;
   }
 };
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RILContentHelper,
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -85,23 +85,23 @@ const RIL_IPC_MOBILECONNECTION_MSG_NAMES
   "RIL:GetNumRadioInterfaces",
   "RIL:GetRilContext",
   "RIL:GetAvailableNetworks",
   "RIL:SelectNetwork",
   "RIL:SelectNetworkAuto",
   "RIL:SendMMI",
   "RIL:CancelMMI",
   "RIL:RegisterMobileConnectionMsg",
-  "RIL:SetCallForwardingOptions",
-  "RIL:GetCallForwardingOptions",
-  "RIL:SetCallBarringOptions",
-  "RIL:GetCallBarringOptions",
+  "RIL:SetCallForwardingOption",
+  "RIL:GetCallForwardingOption",
+  "RIL:SetCallBarringOption",
+  "RIL:GetCallBarringOption",
   "RIL:ChangeCallBarringPassword",
-  "RIL:SetCallWaitingOptions",
-  "RIL:GetCallWaitingOptions",
+  "RIL:SetCallWaitingOption",
+  "RIL:GetCallWaitingOption",
   "RIL:SetCallingLineIdRestriction",
   "RIL:GetCallingLineIdRestriction",
   "RIL:SetRoamingPreference",
   "RIL:GetRoamingPreference",
   "RIL:ExitEmergencyCbMode",
   "RIL:SetVoicePrivacyMode",
   "RIL:GetVoicePrivacyMode"
 ];
@@ -930,35 +930,35 @@ RadioInterface.prototype = {
         this.workerMessenger.sendWithIPCMessage(msg, "iccExchangeAPDU");
         break;
       case "RIL:ReadIccContacts":
         this.workerMessenger.sendWithIPCMessage(msg, "readICCContacts");
         break;
       case "RIL:UpdateIccContact":
         this.workerMessenger.sendWithIPCMessage(msg, "updateICCContact");
         break;
-      case "RIL:SetCallForwardingOptions":
-        this.setCallForwardingOptions(msg.target, msg.json.data);
+      case "RIL:SetCallForwardingOption":
+        this.setCallForwardingOption(msg.target, msg.json.data);
         break;
-      case "RIL:GetCallForwardingOptions":
+      case "RIL:GetCallForwardingOption":
         this.workerMessenger.sendWithIPCMessage(msg, "queryCallForwardStatus");
         break;
-      case "RIL:SetCallBarringOptions":
+      case "RIL:SetCallBarringOption":
         this.workerMessenger.sendWithIPCMessage(msg, "setCallBarring");
         break;
-      case "RIL:GetCallBarringOptions":
+      case "RIL:GetCallBarringOption":
         this.workerMessenger.sendWithIPCMessage(msg, "queryCallBarringStatus");
         break;
       case "RIL:ChangeCallBarringPassword":
         this.workerMessenger.sendWithIPCMessage(msg, "changeCallBarringPassword");
         break;
-      case "RIL:SetCallWaitingOptions":
+      case "RIL:SetCallWaitingOption":
         this.workerMessenger.sendWithIPCMessage(msg, "setCallWaiting");
         break;
-      case "RIL:GetCallWaitingOptions":
+      case "RIL:GetCallWaitingOption":
         this.workerMessenger.sendWithIPCMessage(msg, "queryCallWaiting");
         break;
       case "RIL:SetCallingLineIdRestriction":
         this.setCallingLineIdRestriction(msg.target, msg.json.data);
         break;
       case "RIL:GetCallingLineIdRestriction":
         this.workerMessenger.sendWithIPCMessage(msg, "getCLIR");
         break;
@@ -2401,22 +2401,22 @@ RadioInterface.prototype = {
       target.sendAsyncMessage("RIL:SendMMI", {
         clientId: this.clientId,
         data: response
       });
       return false;
     }).bind(this));
   },
 
-  setCallForwardingOptions: function setCallForwardingOptions(target, message) {
-    if (DEBUG) this.debug("setCallForwardingOptions: " + JSON.stringify(message));
+  setCallForwardingOption: function setCallForwardingOption(target, message) {
+    if (DEBUG) this.debug("setCallForwardingOption: " + JSON.stringify(message));
     message.serviceClass = RIL.ICC_SERVICE_CLASS_VOICE;
     this.workerMessenger.send("setCallForward", message, (function(response) {
       this._sendCfStateChanged(response);
-      target.sendAsyncMessage("RIL:SetCallForwardingOptions", {
+      target.sendAsyncMessage("RIL:SetCallForwardingOption", {
         clientId: this.clientId,
         data: response
       });
       return false;
     }).bind(this));
   },
 
   setCallingLineIdRestriction: function setCallingLineIdRestriction(target,