Migrate to @Override to remove warnings.

Bug: 6303344
Change-Id: I0d33b2ed448467379d576ccd71fb5ae20c878852
This commit is contained in:
Jeff Sharkey
2012-04-09 10:49:19 -07:00
parent 27421b1665
commit 1ba1b673f5
5 changed files with 30 additions and 20 deletions

View File

@@ -155,7 +155,7 @@ public class NetworkStats implements Parcelable {
operations = parcel.createLongArray(); operations = parcel.createLongArray();
} }
/** {@inheritDoc} */ @Override
public void writeToParcel(Parcel dest, int flags) { public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(elapsedRealtime); dest.writeLong(elapsedRealtime);
dest.writeInt(size); dest.writeInt(size);
@@ -662,16 +662,18 @@ public class NetworkStats implements Parcelable {
return writer.toString(); return writer.toString();
} }
/** {@inheritDoc} */ @Override
public int describeContents() { public int describeContents() {
return 0; return 0;
} }
public static final Creator<NetworkStats> CREATOR = new Creator<NetworkStats>() { public static final Creator<NetworkStats> CREATOR = new Creator<NetworkStats>() {
@Override
public NetworkStats createFromParcel(Parcel in) { public NetworkStats createFromParcel(Parcel in) {
return new NetworkStats(in); return new NetworkStats(in);
} }
@Override
public NetworkStats[] newArray(int size) { public NetworkStats[] newArray(int size) {
return new NetworkStats[size]; return new NetworkStats[size];
} }

View File

@@ -130,7 +130,7 @@ public class NetworkStatsHistory implements Parcelable {
totalBytes = in.readLong(); totalBytes = in.readLong();
} }
/** {@inheritDoc} */ @Override
public void writeToParcel(Parcel out, int flags) { public void writeToParcel(Parcel out, int flags) {
out.writeLong(bucketDuration); out.writeLong(bucketDuration);
writeLongArray(out, bucketStart, bucketCount); writeLongArray(out, bucketStart, bucketCount);
@@ -191,7 +191,7 @@ public class NetworkStatsHistory implements Parcelable {
writeVarLongArray(out, operations, bucketCount); writeVarLongArray(out, operations, bucketCount);
} }
/** {@inheritDoc} */ @Override
public int describeContents() { public int describeContents() {
return 0; return 0;
} }
@@ -586,10 +586,12 @@ public class NetworkStatsHistory implements Parcelable {
} }
public static final Creator<NetworkStatsHistory> CREATOR = new Creator<NetworkStatsHistory>() { public static final Creator<NetworkStatsHistory> CREATOR = new Creator<NetworkStatsHistory>() {
@Override
public NetworkStatsHistory createFromParcel(Parcel in) { public NetworkStatsHistory createFromParcel(Parcel in) {
return new NetworkStatsHistory(in); return new NetworkStatsHistory(in);
} }
@Override
public NetworkStatsHistory[] newArray(int size) { public NetworkStatsHistory[] newArray(int size) {
return new NetworkStatsHistory[size]; return new NetworkStatsHistory[size];
} }

View File

@@ -57,8 +57,6 @@ import libcore.io.IoUtils;
* {@link NetworkIdentitySet}, UID, set, and tag. Knows how to persist itself. * {@link NetworkIdentitySet}, UID, set, and tag. Knows how to persist itself.
*/ */
public class NetworkStatsCollection implements FileRotator.Reader { public class NetworkStatsCollection implements FileRotator.Reader {
private static final String TAG = "NetworkStatsCollection";
/** File header magic number: "ANET" */ /** File header magic number: "ANET" */
private static final int FILE_MAGIC = 0x414E4554; 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, public void recordData(NetworkIdentitySet ident, int uid, int set, int tag, long start,
long end, NetworkStats.Entry entry) { long end, NetworkStats.Entry entry) {
@@ -227,7 +225,7 @@ public class NetworkStatsCollection implements FileRotator.Reader {
} }
} }
/** {@inheritDoc} */ @Override
public void read(InputStream in) throws IOException { public void read(InputStream in) throws IOException {
read(new DataInputStream(in)); read(new DataInputStream(in));
} }
@@ -502,7 +500,7 @@ public class NetworkStatsCollection implements FileRotator.Reader {
return false; return false;
} }
/** {@inheritDoc} */ @Override
public int compareTo(Key another) { public int compareTo(Key another) {
return Integer.compare(uid, another.uid); return Integer.compare(uid, another.uid);
} }

View File

@@ -240,22 +240,22 @@ public class NetworkStatsRecorder {
mCollection = checkNotNull(collection, "missing NetworkStatsCollection"); mCollection = checkNotNull(collection, "missing NetworkStatsCollection");
} }
/** {@inheritDoc} */ @Override
public void reset() { public void reset() {
// ignored // ignored
} }
/** {@inheritDoc} */ @Override
public void read(InputStream in) throws IOException { public void read(InputStream in) throws IOException {
mCollection.read(in); mCollection.read(in);
} }
/** {@inheritDoc} */ @Override
public boolean shouldWrite() { public boolean shouldWrite() {
return true; return true;
} }
/** {@inheritDoc} */ @Override
public void write(OutputStream out) throws IOException { public void write(OutputStream out) throws IOException {
mCollection.write(new DataOutputStream(out)); mCollection.write(new DataOutputStream(out));
mCollection.reset(); mCollection.reset();
@@ -275,24 +275,24 @@ public class NetworkStatsRecorder {
mUid = uid; mUid = uid;
} }
/** {@inheritDoc} */ @Override
public void reset() { public void reset() {
mTemp.reset(); mTemp.reset();
} }
/** {@inheritDoc} */ @Override
public void read(InputStream in) throws IOException { public void read(InputStream in) throws IOException {
mTemp.read(in); mTemp.read(in);
mTemp.clearDirty(); mTemp.clearDirty();
mTemp.removeUid(mUid); mTemp.removeUid(mUid);
} }
/** {@inheritDoc} */ @Override
public boolean shouldWrite() { public boolean shouldWrite() {
return mTemp.isDirty(); return mTemp.isDirty();
} }
/** {@inheritDoc} */ @Override
public void write(OutputStream out) throws IOException { public void write(OutputStream out) throws IOException {
mTemp.write(new DataOutputStream(out)); mTemp.write(new DataOutputStream(out));
} }

View File

@@ -999,7 +999,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
} }
private Handler.Callback mHandlerCallback = new Handler.Callback() { private Handler.Callback mHandlerCallback = new Handler.Callback() {
/** {@inheritDoc} */ @Override
public boolean handleMessage(Message msg) { public boolean handleMessage(Message msg) {
switch (msg.what) { switch (msg.what) {
case MSG_PERFORM_POLL: { case MSG_PERFORM_POLL: {
@@ -1038,7 +1038,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
} }
private class DropBoxNonMonotonicObserver implements NonMonotonicObserver<String> { private class DropBoxNonMonotonicObserver implements NonMonotonicObserver<String> {
/** {@inheritDoc} */ @Override
public void foundNonMonotonic(NetworkStats left, int leftIndex, NetworkStats right, public void foundNonMonotonic(NetworkStats left, int leftIndex, NetworkStats right,
int rightIndex, String cookie) { int rightIndex, String cookie) {
Log.w(TAG, "found non-monotonic values; saving to dropbox"); 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 static class DefaultNetworkStatsSettings implements NetworkStatsSettings {
private final ContentResolver mResolver; private final ContentResolver mResolver;
@@ -1075,19 +1076,24 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
return Settings.Secure.getInt(mResolver, name, defInt) != 0; return Settings.Secure.getInt(mResolver, name, defInt) != 0;
} }
@Override
public long getPollInterval() { public long getPollInterval() {
return getSecureLong(NETSTATS_POLL_INTERVAL, 30 * MINUTE_IN_MILLIS); return getSecureLong(NETSTATS_POLL_INTERVAL, 30 * MINUTE_IN_MILLIS);
} }
@Override
public long getTimeCacheMaxAge() { public long getTimeCacheMaxAge() {
return getSecureLong(NETSTATS_TIME_CACHE_MAX_AGE, DAY_IN_MILLIS); return getSecureLong(NETSTATS_TIME_CACHE_MAX_AGE, DAY_IN_MILLIS);
} }
@Override
public long getGlobalAlertBytes() { public long getGlobalAlertBytes() {
return getSecureLong(NETSTATS_GLOBAL_ALERT_BYTES, 2 * MB_IN_BYTES); return getSecureLong(NETSTATS_GLOBAL_ALERT_BYTES, 2 * MB_IN_BYTES);
} }
@Override
public boolean getSampleEnabled() { public boolean getSampleEnabled() {
return getSecureBoolean(NETSTATS_SAMPLE_ENABLED, true); return getSecureBoolean(NETSTATS_SAMPLE_ENABLED, true);
} }
@Override
public Config getDevConfig() { public Config getDevConfig() {
return new Config(getSecureLong(NETSTATS_DEV_BUCKET_DURATION, HOUR_IN_MILLIS), return new Config(getSecureLong(NETSTATS_DEV_BUCKET_DURATION, HOUR_IN_MILLIS),
getSecureLong(NETSTATS_DEV_PERSIST_BYTES, 2 * MB_IN_BYTES), 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)); getSecureLong(NETSTATS_DEV_DELETE_AGE, 90 * DAY_IN_MILLIS));
} }
@Override
public Config getUidConfig() { public Config getUidConfig() {
return new Config(getSecureLong(NETSTATS_UID_BUCKET_DURATION, 2 * HOUR_IN_MILLIS), return new Config(getSecureLong(NETSTATS_UID_BUCKET_DURATION, 2 * HOUR_IN_MILLIS),
getSecureLong(NETSTATS_UID_PERSIST_BYTES, 2 * MB_IN_BYTES), 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)); getSecureLong(NETSTATS_UID_DELETE_AGE, 90 * DAY_IN_MILLIS));
} }
@Override
public Config getUidTagConfig() { public Config getUidTagConfig() {
return new Config(getSecureLong(NETSTATS_UID_BUCKET_DURATION, 2 * HOUR_IN_MILLIS), return new Config(getSecureLong(NETSTATS_UID_BUCKET_DURATION, 2 * HOUR_IN_MILLIS),
getSecureLong(NETSTATS_UID_PERSIST_BYTES, 2 * MB_IN_BYTES), getSecureLong(NETSTATS_UID_PERSIST_BYTES, 2 * MB_IN_BYTES),