Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35fd1048 authored by Martin Olsson 4's avatar Martin Olsson 4 Committed by Steve Kondik
Browse files

Perform NTP lookup at Mobile data connections

If NITZ isn't supported by the current carrier the Android framework
relies instead on a remote NTP server to set the system clock. The
NetworkTimeUpdateService class polls for NTP time during the first 4
minutes after boot, failing to get NTP time within these minutes will
increase the polling interval to 24 hours. Hence, if a data connection
isn't activated directly after boot it can take a long time for the
system clock to be updated. To prevent this situation, NTP lookup is
scheduled as soon as a Mobile data connection has been established.

Change-Id: I046e0330147e7ace4b720a7e70f9d5047d42cfe6
parent ad4d5df9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -253,10 +253,11 @@ public class NetworkTimeUpdateService {
                        .getSystemService(Context.CONNECTIVITY_SERVICE);
                final NetworkInfo netInfo = connManager.getActiveNetworkInfo();
                if (netInfo != null) {
                    // Verify that it's a WIFI connection
                    if (netInfo.getState() == NetworkInfo.State.CONNECTED &&
                            (netInfo.getType() == ConnectivityManager.TYPE_WIFI ||
                                netInfo.getType() == ConnectivityManager.TYPE_ETHERNET) ) {
                                netInfo.getType() == ConnectivityManager.TYPE_ETHERNET ||
                                netInfo.getType() == ConnectivityManager.TYPE_WIMAX ||
                                netInfo.getType() == ConnectivityManager.TYPE_MOBILE)) {
                        mHandler.obtainMessage(EVENT_NETWORK_CONNECTED).sendToTarget();
                    }
                }