diff options
author | Mike Lockwood <lockwood@android.com> | 2011-11-09 10:49:29 -0800 |
---|---|---|
committer | Mike Lockwood <lockwood@google.com> | 2012-02-10 14:44:05 -0800 |
commit | a5abdb9e580f7598ae5553f4490d16871453f9f5 (patch) | |
tree | 8f2f5bf6181fa935660ea9e27e9b1a96a82a291b /services/java/com/android/server/NetworkTimeUpdateService.java | |
parent | fcb310f93680b87943c90a321e2beedcb8c528b8 (diff) |
NetworkTimeUpdateService: Schedule NTP on ethernet connect as well as wifi
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'services/java/com/android/server/NetworkTimeUpdateService.java')
-rw-r--r-- | services/java/com/android/server/NetworkTimeUpdateService.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/services/java/com/android/server/NetworkTimeUpdateService.java b/services/java/com/android/server/NetworkTimeUpdateService.java index a7d19929133b..1ff914f2afd2 100644 --- a/services/java/com/android/server/NetworkTimeUpdateService.java +++ b/services/java/com/android/server/NetworkTimeUpdateService.java @@ -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; } |