From 73cd51894e608095a659aefaca9bf1232898bdc1 Mon Sep 17 00:00:00 2001 From: Gene Lian Date: Sat, 2 Nov 2013 17:36:28 +0800 Subject: [PATCH] Backout b796080cf4d0 (bug 931699) due to causing bug 933787. --- dom/system/gonk/RadioInterfaceLayer.js | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index f16c079c5dc1..bc48806c869a 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -2209,28 +2209,13 @@ RadioInterface.prototype = { break; case kNetworkInterfaceStateChangedTopic: let network = subject.QueryInterface(Ci.nsINetworkInterface); - if (network.state != Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED) { - return; - } - - // SNTP can only update when we have mobile or Wifi connections. - if (network.type != Ci.nsINetworkInterface.NETWORK_TYPE_WIFI && - network.type != Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE) { - return; - } - - // If the network comes from RIL, make sure the RIL service is matched. - if (subject instanceof Ci.nsIRilNetworkInterface) { - network = subject.QueryInterface(Ci.nsIRilNetworkInterface); - if (network.serviceId != this.clientId) { - return; + if (network.state == Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED) { + // Check SNTP when we have data connection, this may not take + // effect immediately before the setting get enabled. + if (this._sntp.isExpired()) { + this._sntp.request(); } } - - // SNTP won't update unless the SNTP is already expired. - if (this._sntp.isExpired()) { - this._sntp.request(); - } break; case kScreenStateChangedTopic: this.workerMessenger.send("setScreenState", { on: (data === "on") });