diff options
author | Jayachandran Chinnakkannu <jayachandranc@google.com> | 2021-06-03 19:35:44 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-06-03 19:35:44 +0000 |
commit | 65b0d73c8105e5b83879d34e7ee015ada05d78b2 (patch) | |
tree | 3823757063c8056c33f840de3843d06640c190a3 /telephony/java | |
parent | abbed5aeaa31f7604d377370c88084d1c6284be1 (diff) | |
parent | 3d749d67ae4ff2430b3ef36af840e70d63b12d30 (diff) |
Merge "Override equals and hashCode methods for EpsBearerQosSessionAttributes and NrQosSessionAttributes" into sc-dev
Diffstat (limited to 'telephony/java')
-rw-r--r-- | telephony/java/android/telephony/data/EpsBearerQosSessionAttributes.java | 20 | ||||
-rw-r--r-- | telephony/java/android/telephony/data/NrQosSessionAttributes.java | 24 |
2 files changed, 44 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/data/EpsBearerQosSessionAttributes.java b/telephony/java/android/telephony/data/EpsBearerQosSessionAttributes.java index 9bc7a5c6cf96..fe4453081362 100644 --- a/telephony/java/android/telephony/data/EpsBearerQosSessionAttributes.java +++ b/telephony/java/android/telephony/data/EpsBearerQosSessionAttributes.java @@ -206,6 +206,26 @@ public final class EpsBearerQosSessionAttributes implements Parcelable, QosSessi } } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + EpsBearerQosSessionAttributes epsBearerAttr = (EpsBearerQosSessionAttributes) o; + return mQci == epsBearerAttr.mQci + && mMaxUplinkBitRate == epsBearerAttr.mMaxUplinkBitRate + && mMaxDownlinkBitRate == epsBearerAttr.mMaxDownlinkBitRate + && mGuaranteedUplinkBitRate == epsBearerAttr.mGuaranteedUplinkBitRate + && mGuaranteedDownlinkBitRate == epsBearerAttr.mGuaranteedDownlinkBitRate + && mRemoteAddresses.size() == epsBearerAttr.mRemoteAddresses.size() + && mRemoteAddresses.containsAll(epsBearerAttr.mRemoteAddresses); + } + + @Override + public int hashCode() { + return Objects.hash(mQci, mMaxUplinkBitRate, mMaxDownlinkBitRate, + mGuaranteedUplinkBitRate, mGuaranteedDownlinkBitRate, mRemoteAddresses); + } + @NonNull public static final Creator<EpsBearerQosSessionAttributes> CREATOR = new Creator<EpsBearerQosSessionAttributes>() { diff --git a/telephony/java/android/telephony/data/NrQosSessionAttributes.java b/telephony/java/android/telephony/data/NrQosSessionAttributes.java index 4c37687910a1..c3a0eedf3d7d 100644 --- a/telephony/java/android/telephony/data/NrQosSessionAttributes.java +++ b/telephony/java/android/telephony/data/NrQosSessionAttributes.java @@ -241,6 +241,30 @@ public final class NrQosSessionAttributes implements Parcelable, QosSessionAttri } } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + NrQosSessionAttributes nrQosAttr = (NrQosSessionAttributes) o; + return m5Qi == nrQosAttr.m5Qi + && mQfi == nrQosAttr.mQfi + && mMaxUplinkBitRate == nrQosAttr.mMaxUplinkBitRate + && mMaxDownlinkBitRate == nrQosAttr.mMaxDownlinkBitRate + && mGuaranteedUplinkBitRate == nrQosAttr.mGuaranteedUplinkBitRate + && mGuaranteedDownlinkBitRate == nrQosAttr.mGuaranteedDownlinkBitRate + && mAveragingWindow == nrQosAttr.mAveragingWindow + && mRemoteAddresses.size() == nrQosAttr.mRemoteAddresses.size() + && mRemoteAddresses.containsAll(nrQosAttr.mRemoteAddresses); + } + + @Override + public int hashCode() { + return Objects.hash(m5Qi, mQfi, mMaxUplinkBitRate, + mMaxDownlinkBitRate, mGuaranteedUplinkBitRate, + mGuaranteedDownlinkBitRate, mAveragingWindow, mRemoteAddresses); + } + + @NonNull public static final Creator<NrQosSessionAttributes> CREATOR = new Creator<NrQosSessionAttributes>() { |