Bug 1162865 - [DataCall] Do not reset data call's linkInfo if it's still needed. r=echen
authorJessica Jong <jjong@mozilla.com>
Mon, 11 May 2015 17:09:40 +0800
changeset 243240 5090e36570e37cf02e48569f6921df995e7c47d2
parent 243239 2c59a22c4df8d2a398da93faceaaef3d18560702
child 243241 edbd586270ed5a626d27de56f7a842759e79223c
push id28735
push usercbook@mozilla.com
push dateTue, 12 May 2015 09:56:47 +0000
treeherdermozilla-central@8b64c75b0b86 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen
bugs1162865
milestone40.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 1162865 - [DataCall] Do not reset data call's linkInfo if it's still needed. r=echen
dom/system/gonk/RadioInterfaceLayer.js
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -2829,18 +2829,21 @@ DataCall.prototype = {
       // Notify the DISCONNECTED event immediately after network interface is
       // removed from requestedNetworkIfaces, to make the DataCall, shared or
       // not, to have the same behavior.
       Services.tm.currentThread.dispatch(() => {
         // Do not notify if state changed while this event was being dispatched,
         // the state probably was notified already or need not to be notified.
         if (networkInterface.state == RIL.GECKO_NETWORK_STATE_DISCONNECTED) {
           networkInterface.notifyRILNetworkInterface();
+
           // Clear link info after notifying NetworkManager.
-          this.resetLinkInfo();
+          if (this.requestedNetworkIfaces.length === 0) {
+            this.resetLinkInfo();
+          }
         }
       }, Ci.nsIEventTarget.DISPATCH_NORMAL);
     }
 
     // Only deactivate data call if no more network interface needs this
     // DataCall and if state is CONNECTED, for other states, we simply remove
     // the network interface from requestedNetworkIfaces.
     if (this.requestedNetworkIfaces.length > 0 ||