diff options
Diffstat (limited to 'telephony/java')
3 files changed, 58 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/data/ApnSetting.java b/telephony/java/android/telephony/data/ApnSetting.java index 8b6f2b5c8f08..be1502ad49f2 100644 --- a/telephony/java/android/telephony/data/ApnSetting.java +++ b/telephony/java/android/telephony/data/ApnSetting.java @@ -1551,6 +1551,20 @@ public class ApnSetting implements Parcelable { } /** + * Converts the APN type bitmask to an array of all APN types + * @param apnTypeBitmask bitmask of APN types. + * @return int array of APN types + * @hide + */ + @NonNull + public static int[] getApnTypesFromBitmask(int apnTypeBitmask) { + return APN_TYPE_INT_MAP.keySet().stream() + .filter(type -> ((apnTypeBitmask & type) == type)) + .mapToInt(Integer::intValue) + .toArray(); + } + + /** * Converts the integer representation of APN type to its string representation. * * @param apnType APN type as an integer 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>() { |