зеркало из https://github.com/mozilla/gecko-dev.git
Bug 931699 - SNTP can only update system time when WiFi or Mobile gets connected (not MMS/SUPL). r=skao,echen
This commit is contained in:
Родитель
fe8fbe2947
Коммит
0f1f2b6424
|
@ -2200,13 +2200,28 @@ RadioInterface.prototype = {
|
||||||
break;
|
break;
|
||||||
case kNetworkInterfaceStateChangedTopic:
|
case kNetworkInterfaceStateChangedTopic:
|
||||||
let network = subject.QueryInterface(Ci.nsINetworkInterface);
|
let network = subject.QueryInterface(Ci.nsINetworkInterface);
|
||||||
if (network.state == Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED) {
|
if (network.state != Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED) {
|
||||||
// Check SNTP when we have data connection, this may not take
|
return;
|
||||||
// effect immediately before the setting get enabled.
|
}
|
||||||
if (this._sntp.isExpired()) {
|
|
||||||
this._sntp.request();
|
// 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SNTP won't update unless the SNTP is already expired.
|
||||||
|
if (this._sntp.isExpired()) {
|
||||||
|
this._sntp.request();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case kScreenStateChangedTopic:
|
case kScreenStateChangedTopic:
|
||||||
this.workerMessenger.send("setScreenState", { on: (data === "on") });
|
this.workerMessenger.send("setScreenState", { on: (data === "on") });
|
||||||
|
|
Загрузка…
Ссылка в новой задаче