Commit 9fe1d557 authored by Romain Hunault's avatar Romain Hunault

Merge branch 'v1-oreo-272' into 'v1-oreo-sprint_freetown'

NTP End point (oreo)

See merge request !39
parents a6676065 ecec8542
/*
* Copyright (C) 2008 The Android Open Source Project
* Copyright (C) 2019 e.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -38,7 +39,7 @@ import java.util.Arrays;
*/
public class SntpClient {
private static final String TAG = "SntpClient";
private static final boolean DBG = true;
private static final boolean DBG = false;
private static final int REFERENCE_TIME_OFFSET = 16;
private static final int ORIGINATE_TIME_OFFSET = 24;
......@@ -83,6 +84,7 @@ public class SntpClient {
* @return true if the transaction was successful.
*/
public boolean requestTime(String host, int timeout) {
if (DBG) Log.d(TAG, "request time : " + host);
InetAddress address = null;
try {
address = InetAddress.getByName(host);
......@@ -95,6 +97,7 @@ public class SntpClient {
}
public boolean requestTime(InetAddress address, int port, int timeout) {
if (DBG) Log.d(TAG, "request time addr : " + address.toString());
DatagramSocket socket = null;
final int oldTag = TrafficStats.getAndSetThreadStatsTag(TrafficStats.TAG_SYSTEM_NTP);
try {
......
......@@ -2,6 +2,7 @@
<!--
/*
** Copyright 2009, The Android Open Source Project
** Copyright (C) 2019 e.foundation
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
......@@ -1841,7 +1842,7 @@
<bool name="config_actionMenuItemAllCaps">true</bool>
<!-- Remote server that can provide NTP responses. -->
<string translatable="false" name="config_ntpServer">time.android.com</string>
<string translatable="false" name="config_ntpServer">pool.ntp.org</string>
<!-- Normal polling frequency in milliseconds -->
<integer name="config_ntpPollingInterval">86400000</integer>
<!-- Try-again polling interval in milliseconds, in case the network request failed -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment