Merge "Add @Nullable to Object#equals()" am: 577fd4a912 am: e20d178f56
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1574815 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I7d13a249fabc93baaa0d01de3f9c6cec7ddd11e4
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.net;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.net.NetworkTemplate;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
@@ -95,7 +96,7 @@ public final class DataUsageRequest implements Parcelable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
if (obj instanceof DataUsageRequest == false) return false;
|
||||
DataUsageRequest that = (DataUsageRequest) obj;
|
||||
return that.requestId == this.requestId
|
||||
|
||||
@@ -19,6 +19,7 @@ import static android.net.IpSecManager.INVALID_RESOURCE_ID;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.RequiresFeature;
|
||||
import android.annotation.RequiresPermission;
|
||||
import android.annotation.SystemApi;
|
||||
@@ -150,7 +151,7 @@ public final class IpSecTransform implements AutoCloseable {
|
||||
/**
|
||||
* Standard equals.
|
||||
*/
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) return true;
|
||||
if (!(other instanceof IpSecTransform)) return false;
|
||||
final IpSecTransform rhs = (IpSecTransform) other;
|
||||
|
||||
@@ -18,6 +18,7 @@ package android.net;
|
||||
|
||||
import static android.net.ConnectivityManager.TYPE_WIFI;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.content.Context;
|
||||
import android.net.wifi.WifiInfo;
|
||||
import android.net.wifi.WifiManager;
|
||||
@@ -67,7 +68,7 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
if (obj instanceof NetworkIdentity) {
|
||||
final NetworkIdentity ident = (NetworkIdentity) obj;
|
||||
return mType == ident.mType && mSubType == ident.mSubType && mRoaming == ident.mRoaming
|
||||
|
||||
@@ -412,7 +412,7 @@ public final class NetworkStats implements Parcelable {
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (o instanceof Entry) {
|
||||
final Entry e = (Entry) o;
|
||||
return uid == e.uid && set == e.set && tag == e.tag && metered == e.metered
|
||||
|
||||
@@ -329,7 +329,7 @@ public class NetworkTemplate implements Parcelable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
if (obj instanceof NetworkTemplate) {
|
||||
final NetworkTemplate other = (NetworkTemplate) obj;
|
||||
return mMatchRule == other.mMatchRule
|
||||
|
||||
Reference in New Issue
Block a user