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

Commit a5abdb9e authored by Mike Lockwood's avatar Mike Lockwood Committed by Mike Lockwood
Browse files

NetworkTimeUpdateService: Schedule NTP on ethernet connect as well as wifi

parent fcb310f9
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public class NetworkTimeUpdateService {

    private static final int EVENT_AUTO_TIME_CHANGED = 1;
    private static final int EVENT_POLL_NETWORK_TIME = 2;
    private static final int EVENT_WIFI_CONNECTED = 3;
    private static final int EVENT_NETWORK_CONNECTED = 3;

    /** Normal polling frequency */
    private static final long POLLING_INTERVAL_MS = 24L * 60 * 60 * 1000; // 24 hrs
@@ -240,8 +240,9 @@ public class NetworkTimeUpdateService {
                if (netInfo != null) {
                    // Verify that it's a WIFI connection
                    if (netInfo.getState() == NetworkInfo.State.CONNECTED &&
                            netInfo.getType() == ConnectivityManager.TYPE_WIFI ) {
                        mHandler.obtainMessage(EVENT_WIFI_CONNECTED).sendToTarget();
                            (netInfo.getType() == ConnectivityManager.TYPE_WIFI ||
                                netInfo.getType() == ConnectivityManager.TYPE_ETHERNET) ) {
                        mHandler.obtainMessage(EVENT_NETWORK_CONNECTED).sendToTarget();
                    }
                }
            }
@@ -260,7 +261,7 @@ public class NetworkTimeUpdateService {
            switch (msg.what) {
                case EVENT_AUTO_TIME_CHANGED:
                case EVENT_POLL_NETWORK_TIME:
                case EVENT_WIFI_CONNECTED:
                case EVENT_NETWORK_CONNECTED:
                    onPollNetworkTime(msg.what);
                    break;
            }