Bug 786020 - B2G RIL: get rid of NETWORK_STATE_SUSPENDED. r=marshall_law
authorPhilipp von Weitershausen <philipp@weitershausen.de>
Tue, 28 Aug 2012 11:37:43 -0300
changeset 105691 fc16f1c44039ecb90733417487fbed2bac1c0873
parent 105690 01c626bb5af90be5435cb67aaad5b9b000ab4bfa
child 105692 c4ceb6420c6089489bdc95bccc082c4aad7830b0
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersmarshall_law
bugs786020
milestone18.0a1
Bug 786020 - B2G RIL: get rid of NETWORK_STATE_SUSPENDED. r=marshall_law
dom/system/gonk/RadioInterfaceLayer.js
dom/system/gonk/nsINetworkManager.idl
dom/system/gonk/ril_consts.js
dom/system/gonk/ril_worker.js
dom/wifi/WifiWorker.js
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -1719,17 +1719,16 @@ let RILNetworkInterface = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsINetworkInterface,
                                          Ci.nsIRILDataCallback]),
 
   // nsINetworkInterface
 
   NETWORK_STATE_UNKNOWN:       Ci.nsINetworkInterface.NETWORK_STATE_UNKNOWN,
   NETWORK_STATE_CONNECTING:    Ci.nsINetworkInterface.CONNECTING,
   NETWORK_STATE_CONNECTED:     Ci.nsINetworkInterface.CONNECTED,
-  NETWORK_STATE_SUSPENDED:     Ci.nsINetworkInterface.SUSPENDED,
   NETWORK_STATE_DISCONNECTING: Ci.nsINetworkInterface.DISCONNECTING,
   NETWORK_STATE_DISCONNECTED:  Ci.nsINetworkInterface.DISCONNECTED,
 
   state: Ci.nsINetworkInterface.NETWORK_STATE_UNKNOWN,
 
   NETWORK_TYPE_WIFI:       Ci.nsINetworkInterface.NETWORK_TYPE_WIFI,
   NETWORK_TYPE_MOBILE:     Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE,
   NETWORK_TYPE_MOBILE_MMS: Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS,
@@ -1824,19 +1823,17 @@ let RILNetworkInterface = {
                          .getInterface(Ci.nsIRadioInterfaceLayer);
   },
 
   get connected() {
     return this.state == RIL.GECKO_NETWORK_STATE_CONNECTED;
   },
 
   connect: function connect(options) {
-    if (this.connecting ||
-        this.state == RIL.GECKO_NETWORK_STATE_CONNECTED ||
-        this.state == RIL.GECKO_NETWORK_STATE_SUSPENDED) {
+    if (this.connecting || this.connected) {
       return;
     }
 
     if (!this.registeredAsDataCallCallback) {
       this.mRIL.registerDataCallCallback(this);
       this.registeredAsDataCallCallback = true;
     }
 
--- a/dom/system/gonk/nsINetworkManager.idl
+++ b/dom/system/gonk/nsINetworkManager.idl
@@ -2,25 +2,24 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 /**
  * Information about networks that is exposed to network manager API consumers.
  */
-[scriptable, uuid(49cc227c-3fe7-40a2-bdb5-55e9af797fde)]
+[scriptable, uuid(463ed2f3-1739-41bc-a967-1e816764f915)]
 interface nsINetworkInterface : nsISupports
 {
   const long NETWORK_STATE_UNKNOWN = -1;
   const long NETWORK_STATE_CONNECTING = 0;
   const long NETWORK_STATE_CONNECTED = 1;
-  const long NETWORK_STATE_SUSPENDED = 2;
-  const long NETWORK_STATE_DISCONNECTING = 3;
-  const long NETWORK_STATE_DISCONNECTED = 4;
+  const long NETWORK_STATE_DISCONNECTING = 2;
+  const long NETWORK_STATE_DISCONNECTED = 3;
 
   /**
    * Current network state, one of the NETWORK_STATE_* constants.
    *
    * When this changes, network interface implementations notify the
    * 'network-interface-state-changed' observer notification.
    */
   readonly attribute long state;
--- a/dom/system/gonk/ril_consts.js
+++ b/dom/system/gonk/ril_consts.js
@@ -1411,19 +1411,18 @@ const DATACALL_FAIL_PREF_RADIO_TECH_CHAN
 const DATACALL_FAIL_RADIO_POWER_OFF = -5;
 const DATACALL_FAIL_TETHERED_CALL_ACTIVE = -6;
 const DATACALL_FAIL_ERROR_UNSPECIFIED = 0xffff;
 
 // Keep consistent with nsINetworkManager.NETWORK_STATE_*.
 const GECKO_NETWORK_STATE_UNKNOWN = -1;
 const GECKO_NETWORK_STATE_CONNECTING = 0;
 const GECKO_NETWORK_STATE_CONNECTED = 1;
-const GECKO_NETWORK_STATE_SUSPENDED = 2;
-const GECKO_NETWORK_STATE_DISCONNECTING = 3;
-const GECKO_NETWORK_STATE_DISCONNECTED = 4;
+const GECKO_NETWORK_STATE_DISCONNECTING = 2;
+const GECKO_NETWORK_STATE_DISCONNECTED = 3;
 
 // Used for QUERY_AVAILABLE_NETWORKS status of "unknown"
 const GECKO_QAN_STATE_UNKNOWN = null;
 
 const CALL_FAIL_UNOBTAINABLE_NUMBER = 1;
 const CALL_FAIL_NORMAL = 16;
 const CALL_FAIL_BUSY = 17;
 const CALL_FAIL_CONGESTION = 34;
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -49,17 +49,16 @@ const UINT16_SIZE = 2;
 const UINT32_SIZE = 4;
 const PARCEL_SIZE_SIZE = UINT32_SIZE;
 
 const PDU_HEX_OCTET_SIZE = 4;
 
 const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"];
 
 let RILQUIRKS_CALLSTATE_EXTRA_UINT32 = libcutils.property_get("ro.moz.ril.callstate_extra_int");
-let RILQUIRKS_DATACALLSTATE_DOWN_IS_UP = libcutils.property_get("ro.moz.ril.callstate_down_is_up");
 // This may change at runtime since in RIL v6 and later, we get the version
 // number via the UNSOLICITED_RIL_CONNECTED parcel.
 let RILQUIRKS_V5_LEGACY = libcutils.property_get("ro.moz.ril.v5_legacy");
 let RILQUIRKS_REQUEST_USE_DIAL_EMERGENCY_CALL = libcutils.property_get("ro.moz.ril.dial_emergency_call");
 let RILQUIRKS_MODEM_DEFAULTS_TO_EMERGENCY_MODE = libcutils.property_get("ro.moz.ril.emergency_by_default");
 let RILQUIRKS_SIM_APP_STATE_EXTRA_FIELDS = libcutils.property_get("ro.moz.ril.simstate_extra_field");
 
 // Marker object.
@@ -2490,21 +2489,16 @@ let RIL = {
   },
 
   _setDataCallGeckoState: function _setDataCallGeckoState(datacall) {
     switch (datacall.active) {
       case DATACALL_INACTIVE:
         datacall.state = GECKO_NETWORK_STATE_DISCONNECTED;
         break;
       case DATACALL_ACTIVE_DOWN:
-        datacall.state = GECKO_NETWORK_STATE_SUSPENDED;
-        if (RILQUIRKS_DATACALLSTATE_DOWN_IS_UP) {
-          datacall.state = GECKO_NETWORK_STATE_CONNECTED;
-        }
-        break;
       case DATACALL_ACTIVE_UP:
         datacall.state = GECKO_NETWORK_STATE_CONNECTED;
         break;
     }
   },
 
   _processNetworks: function _processNetworks() {
     let strings = Buf.readStringList();
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -1278,17 +1278,16 @@ let WifiNetworkInterface = {
 
   registered: false,
 
   // nsINetworkInterface
 
   NETWORK_STATE_UNKNOWN:       Ci.nsINetworkInterface.NETWORK_STATE_UNKNOWN,
   NETWORK_STATE_CONNECTING:    Ci.nsINetworkInterface.CONNECTING,
   NETWORK_STATE_CONNECTED:     Ci.nsINetworkInterface.CONNECTED,
-  NETWORK_STATE_SUSPENDED:     Ci.nsINetworkInterface.SUSPENDED,
   NETWORK_STATE_DISCONNECTING: Ci.nsINetworkInterface.DISCONNECTING,
   NETWORK_STATE_DISCONNECTED:  Ci.nsINetworkInterface.DISCONNECTED,
 
   state: Ci.nsINetworkInterface.NETWORK_STATE_UNKNOWN,
 
   NETWORK_TYPE_WIFI:       Ci.nsINetworkInterface.NETWORK_TYPE_WIFI,
   NETWORK_TYPE_MOBILE:     Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE,
   NETWORK_TYPE_MOBILE_MMS: Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS,