Merge "Addition of 'XorEqualsString' method for comparing String" am: e750b5b659 am: 000baa69f6

am: cbebaf2eb9

Change-Id: Id8b139aec8fb3e3bfc1db2fd304647264ba2a947
This commit is contained in:
Jack Yu
2019-10-29 15:53:17 -07:00
committed by android-build-merger

View File

@@ -1191,7 +1191,7 @@ public class ApnSetting implements Parcelable {
&& !other.canHandleType(TYPE_DUN)
&& Objects.equals(this.mApnName, other.mApnName)
&& !typeSameAny(this, other)
&& xorEquals(this.mProxyAddress, other.mProxyAddress)
&& xorEqualsString(this.mProxyAddress, other.mProxyAddress)
&& xorEqualsInt(this.mProxyPort, other.mProxyPort)
&& xorEquals(this.mProtocol, other.mProtocol)
&& xorEquals(this.mRoamingProtocol, other.mRoamingProtocol)
@@ -1200,7 +1200,7 @@ public class ApnSetting implements Parcelable {
&& Objects.equals(this.mMvnoType, other.mMvnoType)
&& Objects.equals(this.mMvnoMatchData, other.mMvnoMatchData)
&& xorEquals(this.mMmsc, other.mMmsc)
&& xorEquals(this.mMmsProxyAddress, other.mMmsProxyAddress)
&& xorEqualsString(this.mMmsProxyAddress, other.mMmsProxyAddress)
&& xorEqualsInt(this.mMmsProxyPort, other.mMmsProxyPort))
&& Objects.equals(this.mNetworkTypeBitmask, other.mNetworkTypeBitmask)
&& Objects.equals(mApnSetId, other.mApnSetId)
@@ -1213,6 +1213,11 @@ public class ApnSetting implements Parcelable {
return first == null || second == null || first.equals(second);
}
// Equal or one is null.
private boolean xorEqualsString(String first, String second) {
return TextUtils.isEmpty(first) || TextUtils.isEmpty(second) || first.equals(second);
}
// Equal or one is not specified.
private boolean xorEqualsInt(int first, int second) {
return first == UNSPECIFIED_INT || second == UNSPECIFIED_INT