Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9649db60 authored by Jack Yu's avatar Jack Yu Committed by android-build-merger
Browse files

Merge "Addition of 'XorEqualsString' method for comparing String" am: e750b5b6 am: 000baa69

am: cbebaf2e

Change-Id: Id8b139aec8fb3e3bfc1db2fd304647264ba2a947
parents 5a6072c8 cbebaf2e
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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