Bug 886239: Remove retryCount from nsIDOMMobileConnection, r=vyang
authorThomas Zimmermann <tdz@users.sourceforge.net>
Fri, 19 Jul 2013 08:48:04 +0200
changeset 152294 ea06c8b82c7f711ec7f730ced64bcd59e9d0fa32
parent 152293 85eaef3146d44133f3ce91dd45c594e3e68a3735
child 152295 21200bb2eaf0c6aad5be300ba03abfce5cb6831a
push id382
push userakeybl@mozilla.com
push dateMon, 21 Oct 2013 21:47:13 +0000
treeherdermozilla-release@5f1868ee45cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvyang
bugs886239
milestone25.0a1
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
Bug 886239: Remove retryCount from nsIDOMMobileConnection, r=vyang The attribute retryCount is deprecated and removed by this patch. When it lands, all users of retryCount have been converted to getCardLockRetryCount.
dom/network/interfaces/nsIDOMMobileConnection.idl
dom/network/interfaces/nsIMobileConnectionProvider.idl
dom/network/src/MobileConnection.cpp
dom/system/gonk/RILContentHelper.js
dom/system/gonk/RadioInterfaceLayer.js
--- a/dom/network/interfaces/nsIDOMMobileConnection.idl
+++ b/dom/network/interfaces/nsIDOMMobileConnection.idl
@@ -6,17 +6,17 @@
 
 interface nsIDOMEventListener;
 interface nsIDOMDOMRequest;
 interface nsIDOMMozMobileConnectionInfo;
 interface nsIDOMMozMobileNetworkInfo;
 interface nsIDOMMozMobileCellInfo;
 interface nsIDOMMozMobileCFInfo;
 
-[scriptable, builtinclass, uuid(7fd42b7e-8100-4f2b-bc85-858603d499c8)]
+[scriptable, builtinclass, uuid(61e5729c-100f-436e-bc20-b7706ec40229)]
 interface nsIDOMMozMobileConnection : nsIDOMEventTarget
 {
   const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
   const long ICC_SERVICE_CLASS_DATA = (1 << 1);
   const long ICC_SERVICE_CLASS_FAX = (1 << 2);
   const long ICC_SERVICE_CLASS_SMS = (1 << 3);
   const long ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4);
   const long ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
@@ -55,24 +55,16 @@ interface nsIDOMMozMobileConnection : ns
   /**
    * These two fields can be accessed by privileged applications with the
    * 'mobilenetwork' permission.
    */
   readonly attribute DOMString lastKnownNetwork;
   readonly attribute DOMString lastKnownHomeNetwork;
 
   /**
-   * Indicates the number of retries remaining when cardState equals 'pinRequired'
-   * or 'pukRequired'.  0 denotes the retry count is unavailable.
-   *
-   * Value is undefined for other cardState values.
-   */
-  readonly attribute long retryCount;
-
-  /**
    * Information about the voice connection.
    */
   readonly attribute nsIDOMMozMobileConnectionInfo voice;
 
   /**
    * Information about the data connection.
    */
   readonly attribute nsIDOMMozMobileConnectionInfo data;
--- a/dom/network/interfaces/nsIMobileConnectionProvider.idl
+++ b/dom/network/interfaces/nsIMobileConnectionProvider.idl
@@ -25,28 +25,27 @@ interface nsIMobileConnectionListener : 
                            in unsigned short timeSeconds,
                            in unsigned short serviceClass);
 };
 
 /**
  * XPCOM component (in the content process) that provides the mobile
  * network information.
  */
-[scriptable, uuid(477d93f0-c913-11e2-8b8b-0800200c9a66)]
+[scriptable, uuid(3fea6ca5-c535-4662-9f42-eb2fc2ae9975)]
 interface nsIMobileConnectionProvider : nsISupports
 {
   /**
    * Called when a content process registers receiving unsolicited messages from
    * RadioInterfaceLayer in the chrome process. Only a content process that has
    * the 'mobileconnection' permission is allowed to register.
    */
   void registerMobileConnectionMsg(in nsIMobileConnectionListener listener);
   void unregisterMobileConnectionMsg(in nsIMobileConnectionListener listener);
 
-  readonly attribute long retryCount;
   readonly attribute nsIDOMMozMobileConnectionInfo voiceConnectionInfo;
   readonly attribute nsIDOMMozMobileConnectionInfo dataConnectionInfo;
   readonly attribute DOMString networkSelectionMode;
 
   nsIDOMDOMRequest getNetworks(in nsIDOMWindow window);
   nsIDOMDOMRequest selectNetwork(in nsIDOMWindow window, in nsIDOMMozMobileNetworkInfo network);
   nsIDOMDOMRequest selectNetworkAutomatically(in nsIDOMWindow window);
 
--- a/dom/network/src/MobileConnection.cpp
+++ b/dom/network/src/MobileConnection.cpp
@@ -156,27 +156,16 @@ MobileConnection::CheckPermission(const 
   NS_ENSURE_TRUE(permMgr, false);
 
   uint32_t permission = nsIPermissionManager::DENY_ACTION;
   permMgr->TestPermissionFromWindow(window, type, &permission);
   return permission == nsIPermissionManager::ALLOW_ACTION;
 }
 
 NS_IMETHODIMP
-MobileConnection::GetRetryCount(int32_t* retryCount)
-{
-  *retryCount = 0;
-
-  if (!mProvider || !CheckPermission("mobileconnection")) {
-    return NS_OK;
-  }
-  return mProvider->GetRetryCount(retryCount);
-}
-
-NS_IMETHODIMP
 MobileConnection::GetVoice(nsIDOMMozMobileConnectionInfo** voice)
 {
   *voice = nullptr;
 
   if (!mProvider || !CheckPermission("mobileconnection")) {
     return NS_OK;
   }
   return mProvider->GetVoiceConnectionInfo(voice);
--- a/dom/system/gonk/RILContentHelper.js
+++ b/dom/system/gonk/RILContentHelper.js
@@ -384,17 +384,16 @@ DOMMMIError.prototype = {
     this.serviceCode = serviceCode;
     this.additionalInformation = additionalInformation;
   },
 };
 
 function RILContentHelper() {
   this.rilContext = {
     cardState:            RIL.GECKO_CARDSTATE_UNKNOWN,
-    retryCount:           0,
     networkSelectionMode: RIL.GECKO_NETWORK_SELECTION_UNKNOWN,
     iccInfo:              new IccInfo(),
     voiceConnectionInfo:  new MobileConnectionInfo(),
     dataConnectionInfo:   new MobileConnectionInfo()
   };
   this.voicemailInfo = new VoicemailInfo();
 
   this.initDOMRequestHelper(/* aWindow */ null, RIL_IPC_MSG_NAMES);
@@ -476,17 +475,16 @@ RILContentHelper.prototype = {
 
     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.retryCount = rilContext.retryCount;
     this.rilContext.networkSelectionMode = rilContext.networkSelectionMode;
     this.updateInfo(rilContext.iccInfo, this.rilContext.iccInfo);
     this.updateConnectionInfo(rilContext.voice, this.rilContext.voiceConnectionInfo);
     this.updateConnectionInfo(rilContext.data, this.rilContext.dataConnectionInfo);
 
     return this.rilContext;
   },
 
@@ -509,21 +507,16 @@ RILContentHelper.prototype = {
     return context && context.dataConnectionInfo;
   },
 
   get cardState() {
     let context = this.getRilContext();
     return context && context.cardState;
   },
 
-  get retryCount() {
-    let context = this.getRilContext();
-    return context && context.retryCount;
-  },
-
   get networkSelectionMode() {
     let context = this.getRilContext();
     return context && context.networkSelectionMode;
   },
 
   /**
    * The network that is currently trying to be selected (or "automatic").
    * This helps ensure that only one network is selected at a time.
@@ -1370,17 +1363,16 @@ RILContentHelper.prototype = {
   },
 
   receiveMessage: function receiveMessage(msg) {
     let request;
     debug("Received message '" + msg.name + "': " + JSON.stringify(msg.json));
     switch (msg.name) {
       case "RIL:CardStateChanged": {
         let data = msg.json.data;
-        this.rilContext.retryCount = data.retryCount;
         if (this.rilContext.cardState != data.cardState) {
           this.rilContext.cardState = data.cardState;
           this._deliverEvent("_iccListeners",
                              "notifyCardStateChanged",
                              null);
         }
         break;
       }
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -632,17 +632,16 @@ function RadioInterface(options) {
 
   // Pass initial options to ril_worker.
   options.rilMessageType = "setInitialOptions";
   this.worker.postMessage(options);
 
   this.rilContext = {
     radioState:     RIL.GECKO_RADIOSTATE_UNAVAILABLE,
     cardState:      RIL.GECKO_CARDSTATE_UNKNOWN,
-    retryCount:     0,  // TODO: Please see bug 868896
     networkSelectionMode: RIL.GECKO_NETWORK_SELECTION_UNKNOWN,
     iccInfo:        null,
     imsi:           null,
 
     // These objects implement the nsIDOMMozMobileConnectionInfo interface,
     // although the actual implementation lives in the content process. So are
     // the child attributes `network` and `cell`, which implement
     // nsIDOMMozMobileNetworkInfo and nsIDOMMozMobileCellInfo respectively.