diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-05-12 10:57:00 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-05-12 10:57:00 +0000 |
commit | 25157d1128a8da645c32a1a50af8498137e9b350 (patch) | |
tree | fa40dfe3d9f8039038c7933e27f43b8daf88a3b4 | |
parent | 0f603e1ffbe632bb1af94cbafe3af577746b52e3 (diff) | |
parent | f419d33c6ae84111ec9ddae85f46d37763e0da3a (diff) | |
download | base-25157d1128a8da645c32a1a50af8498137e9b350.tar.gz |
Merge "Fixed the incorrect APN dedupling"
-rw-r--r-- | telephony/java/android/telephony/data/ApnSetting.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/telephony/java/android/telephony/data/ApnSetting.java b/telephony/java/android/telephony/data/ApnSetting.java index b0ddf2c28dff..a710e38538ce 100644 --- a/telephony/java/android/telephony/data/ApnSetting.java +++ b/telephony/java/android/telephony/data/ApnSetting.java @@ -1290,8 +1290,8 @@ public class ApnSetting implements Parcelable { && Objects.equals(this.mOperatorNumeric, other.mOperatorNumeric) && Objects.equals(this.mProtocol, other.mProtocol) && Objects.equals(this.mRoamingProtocol, other.mRoamingProtocol) - && xorEqualsInt(this.mMtuV4, other.mMtuV4) - && xorEqualsInt(this.mMtuV6, other.mMtuV6) + && mtuUnsetOrEquals(this.mMtuV4, other.mMtuV4) + && mtuUnsetOrEquals(this.mMtuV6, other.mMtuV6) && Objects.equals(this.mCarrierEnabled, other.mCarrierEnabled) && Objects.equals(this.mNetworkTypeBitmask, other.mNetworkTypeBitmask) && Objects.equals(this.mLingeringNetworkTypeBitmask, @@ -1319,7 +1319,12 @@ public class ApnSetting implements Parcelable { // Equal or one is not specified. private boolean xorEqualsInt(int first, int second) { return first == UNSPECIFIED_INT || second == UNSPECIFIED_INT - || Objects.equals(first, second); + || first == second; + } + + // Equal or one is not specified. Specific to MTU where <= 0 indicates unset. + private boolean mtuUnsetOrEquals(int first, int second) { + return first <= 0 || second <= 0 || first == second; } private String nullToEmpty(String stringValue) { |