Skip to content

Commit 023c05a

Browse files
committed
Move to Global.NETSTATS and Global.NTP constants.
Bug: 7157464 Change-Id: Ief10fd37940f62420f5684940994c9f93802e0be
1 parent cdfc56a commit 023c05a

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

core/java/android/util/NtpTrustedTime.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public static synchronized NtpTrustedTime getInstance(Context context) {
6060
com.android.internal.R.integer.config_ntpTimeout);
6161

6262
final String secureServer = Settings.Secure.getString(
63-
resolver, Settings.Secure.NTP_SERVER);
63+
resolver, Settings.Global.NTP_SERVER);
6464
final long timeout = Settings.Secure.getLong(
65-
resolver, Settings.Secure.NTP_TIMEOUT, defaultTimeout);
65+
resolver, Settings.Global.NTP_TIMEOUT, defaultTimeout);
6666

6767
final String server = secureServer != null ? secureServer : defaultServer;
6868
sSingleton = new NtpTrustedTime(server, timeout);
@@ -71,7 +71,7 @@ public static synchronized NtpTrustedTime getInstance(Context context) {
7171
return sSingleton;
7272
}
7373

74-
/** {@inheritDoc} */
74+
@Override
7575
public boolean forceRefresh() {
7676
if (mServer == null) {
7777
// missing server, so no trusted time available
@@ -91,12 +91,12 @@ public boolean forceRefresh() {
9191
}
9292
}
9393

94-
/** {@inheritDoc} */
94+
@Override
9595
public boolean hasCache() {
9696
return mHasCache;
9797
}
9898

99-
/** {@inheritDoc} */
99+
@Override
100100
public long getCacheAge() {
101101
if (mHasCache) {
102102
return SystemClock.elapsedRealtime() - mCachedNtpElapsedRealtime;
@@ -105,7 +105,7 @@ public long getCacheAge() {
105105
}
106106
}
107107

108-
/** {@inheritDoc} */
108+
@Override
109109
public long getCacheCertainty() {
110110
if (mHasCache) {
111111
return mCachedNtpCertainty;
@@ -114,7 +114,7 @@ public long getCacheCertainty() {
114114
}
115115
}
116116

117-
/** {@inheritDoc} */
117+
@Override
118118
public long currentTimeMillis() {
119119
if (!mHasCache) {
120120
throw new IllegalStateException("Missing authoritative time source");

services/java/com/android/server/net/NetworkStatsService.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@
3838
import static android.net.NetworkTemplate.buildTemplateWifiWildcard;
3939
import static android.net.TrafficStats.KB_IN_BYTES;
4040
import static android.net.TrafficStats.MB_IN_BYTES;
41-
import static android.provider.Settings.Secure.NETSTATS_DEV_BUCKET_DURATION;
42-
import static android.provider.Settings.Secure.NETSTATS_DEV_DELETE_AGE;
43-
import static android.provider.Settings.Secure.NETSTATS_DEV_PERSIST_BYTES;
44-
import static android.provider.Settings.Secure.NETSTATS_DEV_ROTATE_AGE;
45-
import static android.provider.Settings.Secure.NETSTATS_GLOBAL_ALERT_BYTES;
46-
import static android.provider.Settings.Secure.NETSTATS_POLL_INTERVAL;
47-
import static android.provider.Settings.Secure.NETSTATS_REPORT_XT_OVER_DEV;
48-
import static android.provider.Settings.Secure.NETSTATS_SAMPLE_ENABLED;
49-
import static android.provider.Settings.Secure.NETSTATS_TIME_CACHE_MAX_AGE;
50-
import static android.provider.Settings.Secure.NETSTATS_UID_BUCKET_DURATION;
51-
import static android.provider.Settings.Secure.NETSTATS_UID_DELETE_AGE;
52-
import static android.provider.Settings.Secure.NETSTATS_UID_PERSIST_BYTES;
53-
import static android.provider.Settings.Secure.NETSTATS_UID_ROTATE_AGE;
54-
import static android.provider.Settings.Secure.NETSTATS_UID_TAG_BUCKET_DURATION;
55-
import static android.provider.Settings.Secure.NETSTATS_UID_TAG_DELETE_AGE;
56-
import static android.provider.Settings.Secure.NETSTATS_UID_TAG_PERSIST_BYTES;
57-
import static android.provider.Settings.Secure.NETSTATS_UID_TAG_ROTATE_AGE;
41+
import static android.provider.Settings.Global.NETSTATS_DEV_BUCKET_DURATION;
42+
import static android.provider.Settings.Global.NETSTATS_DEV_DELETE_AGE;
43+
import static android.provider.Settings.Global.NETSTATS_DEV_PERSIST_BYTES;
44+
import static android.provider.Settings.Global.NETSTATS_DEV_ROTATE_AGE;
45+
import static android.provider.Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES;
46+
import static android.provider.Settings.Global.NETSTATS_POLL_INTERVAL;
47+
import static android.provider.Settings.Global.NETSTATS_REPORT_XT_OVER_DEV;
48+
import static android.provider.Settings.Global.NETSTATS_SAMPLE_ENABLED;
49+
import static android.provider.Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE;
50+
import static android.provider.Settings.Global.NETSTATS_UID_BUCKET_DURATION;
51+
import static android.provider.Settings.Global.NETSTATS_UID_DELETE_AGE;
52+
import static android.provider.Settings.Global.NETSTATS_UID_PERSIST_BYTES;
53+
import static android.provider.Settings.Global.NETSTATS_UID_ROTATE_AGE;
54+
import static android.provider.Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION;
55+
import static android.provider.Settings.Global.NETSTATS_UID_TAG_DELETE_AGE;
56+
import static android.provider.Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES;
57+
import static android.provider.Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE;
5858
import static android.telephony.PhoneStateListener.LISTEN_DATA_CONNECTION_STATE;
5959
import static android.telephony.PhoneStateListener.LISTEN_NONE;
6060
import static android.text.format.DateUtils.DAY_IN_MILLIS;

0 commit comments

Comments
 (0)