resolved conflicts for merge of e0b14ea7 to master

Change-Id: Ie018d3e2eba1eb2d655c153880e1951b68c2bd51
This commit is contained in:
Kenny Root
2013-12-13 15:59:51 -08:00
4 changed files with 17 additions and 16 deletions

View File

@@ -26,7 +26,7 @@ import android.net.wifi.WifiManager;
import android.os.Build; import android.os.Build;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import com.android.internal.util.Objects; import java.util.Objects;
/** /**
* Network definition that includes strong identity. Analogous to combining * Network definition that includes strong identity. Analogous to combining
@@ -60,7 +60,7 @@ public class NetworkIdentity {
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hashCode(mType, mSubType, mSubscriberId, mNetworkId, mRoaming); return Objects.hash(mType, mSubType, mSubscriberId, mNetworkId, mRoaming);
} }
@Override @Override
@@ -68,8 +68,8 @@ public class NetworkIdentity {
if (obj instanceof NetworkIdentity) { if (obj instanceof NetworkIdentity) {
final NetworkIdentity ident = (NetworkIdentity) obj; final NetworkIdentity ident = (NetworkIdentity) obj;
return mType == ident.mType && mSubType == ident.mSubType && mRoaming == ident.mRoaming return mType == ident.mType && mSubType == ident.mSubType && mRoaming == ident.mRoaming
&& Objects.equal(mSubscriberId, ident.mSubscriberId) && Objects.equals(mSubscriberId, ident.mSubscriberId)
&& Objects.equal(mNetworkId, ident.mNetworkId); && Objects.equals(mNetworkId, ident.mNetworkId);
} }
return false; return false;
} }

View File

@@ -23,12 +23,12 @@ import android.util.SparseBooleanArray;
import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils; import com.android.internal.util.ArrayUtils;
import com.android.internal.util.Objects;
import java.io.CharArrayWriter; import java.io.CharArrayWriter;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.Objects;
/** /**
* Collection of active network statistics. Can contain summary details across * Collection of active network statistics. Can contain summary details across
@@ -337,7 +337,7 @@ public class NetworkStats implements Parcelable {
public int findIndex(String iface, int uid, int set, int tag) { public int findIndex(String iface, int uid, int set, int tag) {
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
if (uid == this.uid[i] && set == this.set[i] && tag == this.tag[i] if (uid == this.uid[i] && set == this.set[i] && tag == this.tag[i]
&& Objects.equal(iface, this.iface[i])) { && Objects.equals(iface, this.iface[i])) {
return i; return i;
} }
} }
@@ -362,7 +362,7 @@ public class NetworkStats implements Parcelable {
} }
if (uid == this.uid[i] && set == this.set[i] && tag == this.tag[i] if (uid == this.uid[i] && set == this.set[i] && tag == this.tag[i]
&& Objects.equal(iface, this.iface[i])) { && Objects.equals(iface, this.iface[i])) {
return i; return i;
} }
} }

View File

@@ -34,8 +34,9 @@ import android.content.res.Resources;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import java.util.Objects;
import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.Objects;
/** /**
* Template definition used to generically match {@link NetworkIdentity}, * Template definition used to generically match {@link NetworkIdentity},
@@ -176,7 +177,7 @@ public class NetworkTemplate implements Parcelable {
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hashCode(mMatchRule, mSubscriberId, mNetworkId); return Objects.hash(mMatchRule, mSubscriberId, mNetworkId);
} }
@Override @Override
@@ -184,8 +185,8 @@ public class NetworkTemplate implements Parcelable {
if (obj instanceof NetworkTemplate) { if (obj instanceof NetworkTemplate) {
final NetworkTemplate other = (NetworkTemplate) obj; final NetworkTemplate other = (NetworkTemplate) obj;
return mMatchRule == other.mMatchRule return mMatchRule == other.mMatchRule
&& Objects.equal(mSubscriberId, other.mSubscriberId) && Objects.equals(mSubscriberId, other.mSubscriberId)
&& Objects.equal(mNetworkId, other.mNetworkId); && Objects.equals(mNetworkId, other.mNetworkId);
} }
return false; return false;
} }
@@ -235,7 +236,7 @@ public class NetworkTemplate implements Parcelable {
return true; return true;
} else { } else {
return ((sForceAllNetworkTypes || contains(DATA_USAGE_NETWORK_TYPES, ident.mType)) return ((sForceAllNetworkTypes || contains(DATA_USAGE_NETWORK_TYPES, ident.mType))
&& Objects.equal(mSubscriberId, ident.mSubscriberId)); && Objects.equals(mSubscriberId, ident.mSubscriberId));
} }
} }
@@ -280,7 +281,7 @@ public class NetworkTemplate implements Parcelable {
private boolean matchesWifi(NetworkIdentity ident) { private boolean matchesWifi(NetworkIdentity ident) {
switch (ident.mType) { switch (ident.mType) {
case TYPE_WIFI: case TYPE_WIFI:
return Objects.equal( return Objects.equals(
removeDoubleQuotes(mNetworkId), removeDoubleQuotes(ident.mNetworkId)); removeDoubleQuotes(mNetworkId), removeDoubleQuotes(ident.mNetworkId));
default: default:
return false; return false;

View File

@@ -34,7 +34,6 @@ import android.util.AtomicFile;
import com.android.internal.util.ArrayUtils; import com.android.internal.util.ArrayUtils;
import com.android.internal.util.FileRotator; import com.android.internal.util.FileRotator;
import com.android.internal.util.IndentingPrintWriter; import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.Objects;
import com.google.android.collect.Lists; import com.google.android.collect.Lists;
import com.google.android.collect.Maps; import com.google.android.collect.Maps;
@@ -50,6 +49,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import libcore.io.IoUtils; import libcore.io.IoUtils;
@@ -508,7 +508,7 @@ public class NetworkStatsCollection implements FileRotator.Reader {
this.uid = uid; this.uid = uid;
this.set = set; this.set = set;
this.tag = tag; this.tag = tag;
hashCode = Objects.hashCode(ident, uid, set, tag); hashCode = Objects.hash(ident, uid, set, tag);
} }
@Override @Override
@@ -521,7 +521,7 @@ public class NetworkStatsCollection implements FileRotator.Reader {
if (obj instanceof Key) { if (obj instanceof Key) {
final Key key = (Key) obj; final Key key = (Key) obj;
return uid == key.uid && set == key.set && tag == key.tag return uid == key.uid && set == key.set && tag == key.tag
&& Objects.equal(ident, key.ident); && Objects.equals(ident, key.ident);
} }
return false; return false;
} }