Merge "Move to Global.NETSTATS and Global.NTP constants." into jb-mr1-dev
This commit is contained in:
@@ -60,9 +60,9 @@ public class NtpTrustedTime implements TrustedTime {
|
||||
com.android.internal.R.integer.config_ntpTimeout);
|
||||
|
||||
final String secureServer = Settings.Secure.getString(
|
||||
resolver, Settings.Secure.NTP_SERVER);
|
||||
resolver, Settings.Global.NTP_SERVER);
|
||||
final long timeout = Settings.Secure.getLong(
|
||||
resolver, Settings.Secure.NTP_TIMEOUT, defaultTimeout);
|
||||
resolver, Settings.Global.NTP_TIMEOUT, defaultTimeout);
|
||||
|
||||
final String server = secureServer != null ? secureServer : defaultServer;
|
||||
sSingleton = new NtpTrustedTime(server, timeout);
|
||||
@@ -71,7 +71,7 @@ public class NtpTrustedTime implements TrustedTime {
|
||||
return sSingleton;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean forceRefresh() {
|
||||
if (mServer == null) {
|
||||
// missing server, so no trusted time available
|
||||
@@ -91,12 +91,12 @@ public class NtpTrustedTime implements TrustedTime {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean hasCache() {
|
||||
return mHasCache;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public long getCacheAge() {
|
||||
if (mHasCache) {
|
||||
return SystemClock.elapsedRealtime() - mCachedNtpElapsedRealtime;
|
||||
@@ -105,7 +105,7 @@ public class NtpTrustedTime implements TrustedTime {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public long getCacheCertainty() {
|
||||
if (mHasCache) {
|
||||
return mCachedNtpCertainty;
|
||||
@@ -114,7 +114,7 @@ public class NtpTrustedTime implements TrustedTime {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public long currentTimeMillis() {
|
||||
if (!mHasCache) {
|
||||
throw new IllegalStateException("Missing authoritative time source");
|
||||
|
||||
@@ -38,23 +38,23 @@ import static android.net.NetworkTemplate.buildTemplateMobileWildcard;
|
||||
import static android.net.NetworkTemplate.buildTemplateWifiWildcard;
|
||||
import static android.net.TrafficStats.KB_IN_BYTES;
|
||||
import static android.net.TrafficStats.MB_IN_BYTES;
|
||||
import static android.provider.Settings.Secure.NETSTATS_DEV_BUCKET_DURATION;
|
||||
import static android.provider.Settings.Secure.NETSTATS_DEV_DELETE_AGE;
|
||||
import static android.provider.Settings.Secure.NETSTATS_DEV_PERSIST_BYTES;
|
||||
import static android.provider.Settings.Secure.NETSTATS_DEV_ROTATE_AGE;
|
||||
import static android.provider.Settings.Secure.NETSTATS_GLOBAL_ALERT_BYTES;
|
||||
import static android.provider.Settings.Secure.NETSTATS_POLL_INTERVAL;
|
||||
import static android.provider.Settings.Secure.NETSTATS_REPORT_XT_OVER_DEV;
|
||||
import static android.provider.Settings.Secure.NETSTATS_SAMPLE_ENABLED;
|
||||
import static android.provider.Settings.Secure.NETSTATS_TIME_CACHE_MAX_AGE;
|
||||
import static android.provider.Settings.Secure.NETSTATS_UID_BUCKET_DURATION;
|
||||
import static android.provider.Settings.Secure.NETSTATS_UID_DELETE_AGE;
|
||||
import static android.provider.Settings.Secure.NETSTATS_UID_PERSIST_BYTES;
|
||||
import static android.provider.Settings.Secure.NETSTATS_UID_ROTATE_AGE;
|
||||
import static android.provider.Settings.Secure.NETSTATS_UID_TAG_BUCKET_DURATION;
|
||||
import static android.provider.Settings.Secure.NETSTATS_UID_TAG_DELETE_AGE;
|
||||
import static android.provider.Settings.Secure.NETSTATS_UID_TAG_PERSIST_BYTES;
|
||||
import static android.provider.Settings.Secure.NETSTATS_UID_TAG_ROTATE_AGE;
|
||||
import static android.provider.Settings.Global.NETSTATS_DEV_BUCKET_DURATION;
|
||||
import static android.provider.Settings.Global.NETSTATS_DEV_DELETE_AGE;
|
||||
import static android.provider.Settings.Global.NETSTATS_DEV_PERSIST_BYTES;
|
||||
import static android.provider.Settings.Global.NETSTATS_DEV_ROTATE_AGE;
|
||||
import static android.provider.Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES;
|
||||
import static android.provider.Settings.Global.NETSTATS_POLL_INTERVAL;
|
||||
import static android.provider.Settings.Global.NETSTATS_REPORT_XT_OVER_DEV;
|
||||
import static android.provider.Settings.Global.NETSTATS_SAMPLE_ENABLED;
|
||||
import static android.provider.Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE;
|
||||
import static android.provider.Settings.Global.NETSTATS_UID_BUCKET_DURATION;
|
||||
import static android.provider.Settings.Global.NETSTATS_UID_DELETE_AGE;
|
||||
import static android.provider.Settings.Global.NETSTATS_UID_PERSIST_BYTES;
|
||||
import static android.provider.Settings.Global.NETSTATS_UID_ROTATE_AGE;
|
||||
import static android.provider.Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION;
|
||||
import static android.provider.Settings.Global.NETSTATS_UID_TAG_DELETE_AGE;
|
||||
import static android.provider.Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES;
|
||||
import static android.provider.Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE;
|
||||
import static android.telephony.PhoneStateListener.LISTEN_DATA_CONNECTION_STATE;
|
||||
import static android.telephony.PhoneStateListener.LISTEN_NONE;
|
||||
import static android.text.format.DateUtils.DAY_IN_MILLIS;
|
||||
|
||||
Reference in New Issue
Block a user