Migrate to @Override to remove warnings.
Bug: 6303344 Change-Id: I0d33b2ed448467379d576ccd71fb5ae20c878852
This commit is contained in:
@@ -57,8 +57,6 @@ import libcore.io.IoUtils;
|
||||
* {@link NetworkIdentitySet}, UID, set, and tag. Knows how to persist itself.
|
||||
*/
|
||||
public class NetworkStatsCollection implements FileRotator.Reader {
|
||||
private static final String TAG = "NetworkStatsCollection";
|
||||
|
||||
/** File header magic number: "ANET" */
|
||||
private static final int FILE_MAGIC = 0x414E4554;
|
||||
|
||||
@@ -173,7 +171,7 @@ public class NetworkStatsCollection implements FileRotator.Reader {
|
||||
}
|
||||
|
||||
/**
|
||||
* Record given {@link NetworkStats.Entry} into this collection.
|
||||
* Record given {@link android.net.NetworkStats.Entry} into this collection.
|
||||
*/
|
||||
public void recordData(NetworkIdentitySet ident, int uid, int set, int tag, long start,
|
||||
long end, NetworkStats.Entry entry) {
|
||||
@@ -227,7 +225,7 @@ public class NetworkStatsCollection implements FileRotator.Reader {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void read(InputStream in) throws IOException {
|
||||
read(new DataInputStream(in));
|
||||
}
|
||||
@@ -502,7 +500,7 @@ public class NetworkStatsCollection implements FileRotator.Reader {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int compareTo(Key another) {
|
||||
return Integer.compare(uid, another.uid);
|
||||
}
|
||||
|
||||
@@ -240,22 +240,22 @@ public class NetworkStatsRecorder {
|
||||
mCollection = checkNotNull(collection, "missing NetworkStatsCollection");
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void reset() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void read(InputStream in) throws IOException {
|
||||
mCollection.read(in);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean shouldWrite() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void write(OutputStream out) throws IOException {
|
||||
mCollection.write(new DataOutputStream(out));
|
||||
mCollection.reset();
|
||||
@@ -275,24 +275,24 @@ public class NetworkStatsRecorder {
|
||||
mUid = uid;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void reset() {
|
||||
mTemp.reset();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void read(InputStream in) throws IOException {
|
||||
mTemp.read(in);
|
||||
mTemp.clearDirty();
|
||||
mTemp.removeUid(mUid);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean shouldWrite() {
|
||||
return mTemp.isDirty();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void write(OutputStream out) throws IOException {
|
||||
mTemp.write(new DataOutputStream(out));
|
||||
}
|
||||
|
||||
@@ -999,7 +999,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
}
|
||||
|
||||
private Handler.Callback mHandlerCallback = new Handler.Callback() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case MSG_PERFORM_POLL: {
|
||||
@@ -1038,7 +1038,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
}
|
||||
|
||||
private class DropBoxNonMonotonicObserver implements NonMonotonicObserver<String> {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void foundNonMonotonic(NetworkStats left, int leftIndex, NetworkStats right,
|
||||
int rightIndex, String cookie) {
|
||||
Log.w(TAG, "found non-monotonic values; saving to dropbox");
|
||||
@@ -1057,7 +1057,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
}
|
||||
|
||||
/**
|
||||
* Default external settings that read from {@link Settings.Secure}.
|
||||
* Default external settings that read from
|
||||
* {@link android.provider.Settings.Secure}.
|
||||
*/
|
||||
private static class DefaultNetworkStatsSettings implements NetworkStatsSettings {
|
||||
private final ContentResolver mResolver;
|
||||
@@ -1075,19 +1076,24 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
return Settings.Secure.getInt(mResolver, name, defInt) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPollInterval() {
|
||||
return getSecureLong(NETSTATS_POLL_INTERVAL, 30 * MINUTE_IN_MILLIS);
|
||||
}
|
||||
@Override
|
||||
public long getTimeCacheMaxAge() {
|
||||
return getSecureLong(NETSTATS_TIME_CACHE_MAX_AGE, DAY_IN_MILLIS);
|
||||
}
|
||||
@Override
|
||||
public long getGlobalAlertBytes() {
|
||||
return getSecureLong(NETSTATS_GLOBAL_ALERT_BYTES, 2 * MB_IN_BYTES);
|
||||
}
|
||||
@Override
|
||||
public boolean getSampleEnabled() {
|
||||
return getSecureBoolean(NETSTATS_SAMPLE_ENABLED, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Config getDevConfig() {
|
||||
return new Config(getSecureLong(NETSTATS_DEV_BUCKET_DURATION, HOUR_IN_MILLIS),
|
||||
getSecureLong(NETSTATS_DEV_PERSIST_BYTES, 2 * MB_IN_BYTES),
|
||||
@@ -1095,6 +1101,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
getSecureLong(NETSTATS_DEV_DELETE_AGE, 90 * DAY_IN_MILLIS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Config getUidConfig() {
|
||||
return new Config(getSecureLong(NETSTATS_UID_BUCKET_DURATION, 2 * HOUR_IN_MILLIS),
|
||||
getSecureLong(NETSTATS_UID_PERSIST_BYTES, 2 * MB_IN_BYTES),
|
||||
@@ -1102,6 +1109,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
getSecureLong(NETSTATS_UID_DELETE_AGE, 90 * DAY_IN_MILLIS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Config getUidTagConfig() {
|
||||
return new Config(getSecureLong(NETSTATS_UID_BUCKET_DURATION, 2 * HOUR_IN_MILLIS),
|
||||
getSecureLong(NETSTATS_UID_PERSIST_BYTES, 2 * MB_IN_BYTES),
|
||||
|
||||
Reference in New Issue
Block a user