From e3f76496465c6b85d51be0a5fd163c04af9f5575 Mon Sep 17 00:00:00 2001 From: Jinyoung Jeong Date: Thu, 14 Oct 2021 09:23:33 +0000 Subject: [PATCH] IMS RCS API Improvements-DelegateRegistrationState Bug: b/197892699, b/202202874 Test: atest CtsTelephonyTestCases:SipDelegateManagerTest Change-Id: Icfa7fd363ad4f9ad0131d78602c264742cd1785f --- core/api/system-current.txt | 2 ++ .../ims/DelegateRegistrationState.java | 34 +++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 95d06b0351e49..f46f1582f233d 100755 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -13032,6 +13032,7 @@ package android.telephony.ims { method @NonNull public java.util.Set getDeregisteredFeatureTags(); method @NonNull public java.util.Set getDeregisteringFeatureTags(); method @NonNull public java.util.Set getRegisteredFeatureTags(); + method @NonNull public java.util.Set getRegisteringFeatureTags(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; field public static final int DEREGISTERED_REASON_NOT_PROVISIONED = 1; // 0x1 @@ -13049,6 +13050,7 @@ package android.telephony.ims { method @NonNull public android.telephony.ims.DelegateRegistrationState.Builder addDeregisteringFeatureTag(@NonNull String, int); method @NonNull public android.telephony.ims.DelegateRegistrationState.Builder addRegisteredFeatureTag(@NonNull String); method @NonNull public android.telephony.ims.DelegateRegistrationState.Builder addRegisteredFeatureTags(@NonNull java.util.Set); + method @NonNull public android.telephony.ims.DelegateRegistrationState.Builder addRegisteringFeatureTags(@NonNull java.util.Set); method @NonNull public android.telephony.ims.DelegateRegistrationState build(); } diff --git a/telephony/java/android/telephony/ims/DelegateRegistrationState.java b/telephony/java/android/telephony/ims/DelegateRegistrationState.java index c00c741a0d60d..1b1040430fd27 100644 --- a/telephony/java/android/telephony/ims/DelegateRegistrationState.java +++ b/telephony/java/android/telephony/ims/DelegateRegistrationState.java @@ -117,6 +117,7 @@ public final class DelegateRegistrationState implements Parcelable { }) public @interface DeregisteringReason {} + private ArraySet mRegisteringTags = new ArraySet<>(); private ArraySet mRegisteredTags = new ArraySet<>(); private final ArraySet mDeregisteringTags = new ArraySet<>(); private final ArraySet mDeregisteredTags = new ArraySet<>(); @@ -133,6 +134,20 @@ public final class DelegateRegistrationState implements Parcelable { mState = new DelegateRegistrationState(); } + /** + * Add the set of feature tags that are associated with this SipDelegate and + * the IMS stack is actively trying to register on the carrier network. + * + * The feature tags will either move to the registered or deregistered state + * depending on the result of the registration. + * @param featureTags The IMS media feature tags that are in the progress of registering. + * @return The in-progress Builder instance for RegistrationState. ] + */ + public @NonNull Builder addRegisteringFeatureTags(@NonNull Set featureTags) { + mState.mRegisteringTags.addAll(featureTags); + return this; + } + /** * Add a feature tag that is currently included in the current network IMS Registration. * @param featureTag The IMS media feature tag included in the current IMS registration. @@ -209,6 +224,17 @@ public final class DelegateRegistrationState implements Parcelable { mRegisteredTags = (ArraySet) source.readArraySet(null); readStateFromParcel(source, mDeregisteringTags); readStateFromParcel(source, mDeregisteredTags); + mRegisteringTags = (ArraySet) source.readArraySet(null); + } + + /** + * Get the feature tags that are associated with this SipDelegate that the IMS stack is actively + * trying to register on the carrier network. + * @return A Set of feature tags associated with this SipDelegate that the IMS service is + * currently trying to register on the carrier network. + */ + public @NonNull Set getRegisteringFeatureTags() { + return new ArraySet<>(mRegisteringTags); } /** @@ -286,6 +312,7 @@ public final class DelegateRegistrationState implements Parcelable { dest.writeArraySet(mRegisteredTags); writeStateToParcel(dest, mDeregisteringTags); writeStateToParcel(dest, mDeregisteredTags); + dest.writeArraySet(mRegisteringTags); } private void writeStateToParcel(Parcel dest, Set state) { @@ -311,19 +338,22 @@ public final class DelegateRegistrationState implements Parcelable { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DelegateRegistrationState that = (DelegateRegistrationState) o; - return mRegisteredTags.equals(that.mRegisteredTags) + return mRegisteringTags.equals(that.mRegisteringTags) + && mRegisteredTags.equals(that.mRegisteredTags) && mDeregisteringTags.equals(that.mDeregisteringTags) && mDeregisteredTags.equals(that.mDeregisteredTags); } @Override public int hashCode() { - return Objects.hash(mRegisteredTags, mDeregisteringTags, mDeregisteredTags); + return Objects.hash(mRegisteringTags, mRegisteredTags, + mDeregisteringTags, mDeregisteredTags); } @Override public String toString() { return "DelegateRegistrationState{ registered={" + mRegisteredTags + + "}, registering={" + mRegisteringTags + "}, deregistering={" + mDeregisteringTags + "}, deregistered={" + mDeregisteredTags + "}}"; }