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

Commit 6e2a13e7 authored by Brad Ebinger's avatar Brad Ebinger Committed by Automerger Merge Worker
Browse files

Merge "Add SIP Transport create/destroy API defs" am: af18d594

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1511770

Change-Id: Ic9d7e6a7c0f13e3fe4f86f8996b60c4cfedfe9a1
parents 563c167f af18d594
Loading
Loading
Loading
Loading
+176 −0
Original line number Original line Diff line number Diff line
@@ -10693,6 +10693,61 @@ package android.telephony.ims {
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.AudioCodecAttributes> CREATOR;
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.AudioCodecAttributes> CREATOR;
  }
  }
  public interface DelegateMessageCallback {
    method public void onMessageReceived(@NonNull android.telephony.ims.SipMessage);
    method public void onMessageSendFailure(@NonNull String, int);
    method public void onMessageSent(@NonNull String);
  }
  public final class DelegateRegistrationState implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.Set<android.telephony.ims.FeatureTagState> getDeregisteredFeatureTags();
    method @NonNull public java.util.Set<android.telephony.ims.FeatureTagState> getDeregisteringFeatureTags();
    method @NonNull public java.util.Set<java.lang.String> getRegisteredFeatureTags();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.DelegateRegistrationState> CREATOR;
    field public static final int DEREGISTERED_REASON_NOT_PROVISIONED = 1; // 0x1
    field public static final int DEREGISTERED_REASON_NOT_REGISTERED = 2; // 0x2
    field public static final int DEREGISTERED_REASON_UNKNOWN = 0; // 0x0
    field public static final int DEREGISTERING_REASON_DESTROY_PENDING = 6; // 0x6
    field public static final int DEREGISTERING_REASON_FEATURE_TAGS_CHANGING = 5; // 0x5
    field public static final int DEREGISTERING_REASON_PDN_CHANGE = 3; // 0x3
    field public static final int DEREGISTERING_REASON_PROVISIONING_CHANGE = 4; // 0x4
  }
  public static final class DelegateRegistrationState.Builder {
    ctor public DelegateRegistrationState.Builder();
    method @NonNull public android.telephony.ims.DelegateRegistrationState.Builder addDeregisteredFeatureTag(@NonNull String, int);
    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<java.lang.String>);
    method @NonNull public android.telephony.ims.DelegateRegistrationState build();
  }
  public final class DelegateRequest implements android.os.Parcelable {
    ctor public DelegateRequest(@NonNull java.util.Set<java.lang.String>);
    method public int describeContents();
    method @NonNull public java.util.Set<java.lang.String> getFeatureTags();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.DelegateRequest> CREATOR;
  }
  public interface DelegateStateCallback {
    method public void onCreated(@NonNull android.telephony.ims.stub.SipDelegate, @Nullable java.util.Set<android.telephony.ims.FeatureTagState>);
    method public void onDestroyed(int);
    method public void onFeatureTagRegistrationChanged(@NonNull android.telephony.ims.DelegateRegistrationState);
    method public void onImsConfigurationChanged(@NonNull android.telephony.ims.SipDelegateImsConfiguration);
  }
  public final class FeatureTagState implements android.os.Parcelable {
    ctor public FeatureTagState(@NonNull String, int);
    method public int describeContents();
    method @NonNull public String getFeatureTag();
    method public int getState();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.FeatureTagState> CREATOR;
  }
  public final class ImsCallForwardInfo implements android.os.Parcelable {
  public final class ImsCallForwardInfo implements android.os.Parcelable {
    ctor public ImsCallForwardInfo(int, int, int, int, @NonNull String, int);
    ctor public ImsCallForwardInfo(int, int, int, int, @NonNull String, int);
    method public int describeContents();
    method public int describeContents();
@@ -11213,8 +11268,107 @@ package android.telephony.ims {
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.RtpHeaderExtensionType> CREATOR;
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.RtpHeaderExtensionType> CREATOR;
  }
  }
  public interface SipDelegateConnection {
    method public void notifyMessageReceiveError(@NonNull String, int);
    method public void notifyMessageReceived(@NonNull String);
    method public void sendMessage(@NonNull android.telephony.ims.SipMessage, long);
  }
  public final class SipDelegateImsConfiguration implements android.os.Parcelable {
    method public boolean containsKey(@NonNull String);
    method @NonNull public android.os.PersistableBundle copyBundle();
    method public int describeContents();
    method public boolean getBoolean(@NonNull String, boolean);
    method public int getInt(@NonNull String, int);
    method @Nullable public String getString(@NonNull String);
    method public long getVersion();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.SipDelegateImsConfiguration> CREATOR;
    field public static final String IPTYPE_IPV4 = "IPV4";
    field public static final String IPTYPE_IPV6 = "IPV6";
    field public static final String KEY_SIP_CONFIG_AUTHENTICATION_HEADER_STRING = "sip_config_auhentication_header_string";
    field public static final String KEY_SIP_CONFIG_AUTHENTICATION_NONCE_STRING = "sip_config_authentication_nonce_string";
    field public static final String KEY_SIP_CONFIG_HOME_DOMAIN_STRING = "sip_config_home_domain_string";
    field public static final String KEY_SIP_CONFIG_IMEI_STRING = "sip_config_imei_string";
    field public static final String KEY_SIP_CONFIG_IPTYPE_STRING = "sip_config_iptype_string";
    field public static final String KEY_SIP_CONFIG_IS_COMPACT_FORM_ENABLED_BOOL = "sip_config_is_compact_form_enabled_bool";
    field public static final String KEY_SIP_CONFIG_IS_GRUU_ENABLED_BOOL = "sip_config_is_gruu_enabled_bool";
    field public static final String KEY_SIP_CONFIG_IS_IPSEC_ENABLED_BOOL = "sip_config_is_ipsec_enabled_bool";
    field public static final String KEY_SIP_CONFIG_IS_KEEPALIVE_ENABLED_BOOL = "sip_config_is_keepalive_enabled_bool";
    field public static final String KEY_SIP_CONFIG_IS_NAT_ENABLED_BOOL = "sip_config_is_nat_enabled_bool";
    field public static final String KEY_SIP_CONFIG_MAX_PAYLOAD_SIZE_ON_UDP_INT = "sip_config_udp_max_payload_size_int";
    field public static final String KEY_SIP_CONFIG_PATH_HEADER_STRING = "sip_config_path_header_string";
    field public static final String KEY_SIP_CONFIG_P_ACCESS_NETWORK_INFO_HEADER_STRING = "sip_config_p_access_network_info_header_string";
    field public static final String KEY_SIP_CONFIG_P_ASSOCIATED_URI_HEADER_STRING = "sip_config_p_associated_uri_header_string";
    field public static final String KEY_SIP_CONFIG_P_LAST_ACCESS_NETWORK_INFO_HEADER_STRING = "sip_config_p_last_access_network_info_header_string";
    field public static final String KEY_SIP_CONFIG_SECURITY_VERIFY_HEADER_STRING = "sip_config_security_verify_header_string";
    field public static final String KEY_SIP_CONFIG_SERVER_DEFAULT_IPADDRESS_STRING = "sip_config_server_default_ipaddress_string";
    field public static final String KEY_SIP_CONFIG_SERVER_DEFAULT_PORT_INT = "sip_config_server_default_port_int";
    field public static final String KEY_SIP_CONFIG_SERVER_IPSEC_CLIENT_PORT_INT = "sip_config_server_ipsec_client_port_int";
    field public static final String KEY_SIP_CONFIG_SERVER_IPSEC_OLD_CLIENT_PORT_INT = "sip_config_server_ipsec_old_client_port_int";
    field public static final String KEY_SIP_CONFIG_SERVER_IPSEC_SERVER_PORT_INT = "sip_config_server_ipsec_server_port_int";
    field public static final String KEY_SIP_CONFIG_SERVICE_ROUTE_HEADER_STRING = "sip_config_service_route_header_string";
    field public static final String KEY_SIP_CONFIG_TRANSPORT_TYPE_STRING = "sip_config_protocol_type_string";
    field public static final String KEY_SIP_CONFIG_UE_DEFAULT_IPADDRESS_STRING = "sip_config_ue_default_ipaddress_string";
    field public static final String KEY_SIP_CONFIG_UE_DEFAULT_PORT_INT = "sip_config_ue_default_port_int";
    field public static final String KEY_SIP_CONFIG_UE_IPSEC_CLIENT_PORT_INT = "sip_config_ue_ipsec_client_port_int";
    field public static final String KEY_SIP_CONFIG_UE_IPSEC_OLD_CLIENT_PORT_INT = "sip_config_ue_ipsec_old_client_port_int";
    field public static final String KEY_SIP_CONFIG_UE_IPSEC_SERVER_PORT_INT = "sip_config_ue_ipsec_server_port_int";
    field public static final String KEY_SIP_CONFIG_UE_PRIVATE_USER_ID_STRING = "sip_config_ue_private_user_id_string";
    field public static final String KEY_SIP_CONFIG_UE_PUBLIC_GRUU_STRING = "sip_config_ue_public_gruu_string";
    field public static final String KEY_SIP_CONFIG_UE_PUBLIC_IPADDRESS_WITH_NAT_STRING = "sip_config_ue_public_ipaddress_with_nat_string";
    field public static final String KEY_SIP_CONFIG_UE_PUBLIC_PORT_WITH_NAT_INT = "sip_config_ue_public_port_with_nat_int";
    field public static final String KEY_SIP_CONFIG_UE_PUBLIC_USER_ID_STRING = "sip_config_ue_public_user_id_string";
    field public static final String KEY_SIP_CONFIG_URI_USER_PART_STRING = "sip_config_uri_user_part_string";
    field public static final String SIP_TRANSPORT_TCP = "TCP";
    field public static final String SIP_TRANSPORT_UDP = "UDP";
  }
  public static final class SipDelegateImsConfiguration.Builder {
    ctor public SipDelegateImsConfiguration.Builder(int);
    ctor public SipDelegateImsConfiguration.Builder(@NonNull android.telephony.ims.SipDelegateImsConfiguration);
    method @NonNull public android.telephony.ims.SipDelegateImsConfiguration.Builder addBoolean(@NonNull String, boolean);
    method @NonNull public android.telephony.ims.SipDelegateImsConfiguration.Builder addInt(@NonNull String, int);
    method @NonNull public android.telephony.ims.SipDelegateImsConfiguration.Builder addString(@NonNull String, @NonNull String);
    method @NonNull public android.telephony.ims.SipDelegateImsConfiguration build();
  }
  public class SipDelegateManager {
  public class SipDelegateManager {
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void createSipDelegate(@NonNull android.telephony.ims.DelegateRequest, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.stub.DelegateConnectionStateCallback, @NonNull android.telephony.ims.stub.DelegateConnectionMessageCallback) throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void destroySipDelegate(@NonNull android.telephony.ims.SipDelegateConnection, int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSupported() throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSupported() throws android.telephony.ims.ImsException;
    field public static final int DENIED_REASON_INVALID = 4; // 0x4
    field public static final int DENIED_REASON_IN_USE_BY_ANOTHER_DELEGATE = 1; // 0x1
    field public static final int DENIED_REASON_NOT_ALLOWED = 2; // 0x2
    field public static final int DENIED_REASON_SINGLE_REGISTRATION_NOT_ALLOWED = 3; // 0x3
    field public static final int DENIED_REASON_UNKNOWN = 0; // 0x0
    field public static final int MESSAGE_FAILURE_REASON_DELEGATE_CLOSED = 2; // 0x2
    field public static final int MESSAGE_FAILURE_REASON_DELEGATE_DEAD = 1; // 0x1
    field public static final int MESSAGE_FAILURE_REASON_INTERNAL_DELEGATE_STATE_TRANSITION = 11; // 0xb
    field public static final int MESSAGE_FAILURE_REASON_INVALID_BODY_CONTENT = 5; // 0x5
    field public static final int MESSAGE_FAILURE_REASON_INVALID_FEATURE_TAG = 6; // 0x6
    field public static final int MESSAGE_FAILURE_REASON_INVALID_HEADER_FIELDS = 4; // 0x4
    field public static final int MESSAGE_FAILURE_REASON_INVALID_START_LINE = 3; // 0x3
    field public static final int MESSAGE_FAILURE_REASON_NETWORK_NOT_AVAILABLE = 8; // 0x8
    field public static final int MESSAGE_FAILURE_REASON_NOT_REGISTERED = 9; // 0x9
    field public static final int MESSAGE_FAILURE_REASON_STALE_IMS_CONFIGURATION = 10; // 0xa
    field public static final int MESSAGE_FAILURE_REASON_TAG_NOT_ENABLED_FOR_DELEGATE = 7; // 0x7
    field public static final int MESSAGE_FAILURE_REASON_UNKNOWN = 0; // 0x0
    field public static final int SIP_DELEGATE_DESTROY_REASON_REQUESTED_BY_APP = 2; // 0x2
    field public static final int SIP_DELEGATE_DESTROY_REASON_SERVICE_DEAD = 1; // 0x1
    field public static final int SIP_DELEGATE_DESTROY_REASON_SUBSCRIPTION_TORN_DOWN = 4; // 0x4
    field public static final int SIP_DELEGATE_DESTROY_REASON_UNKNOWN = 0; // 0x0
    field public static final int SIP_DELEGATE_DESTROY_REASON_USER_DISABLED_RCS = 3; // 0x3
  }
  public final class SipMessage implements android.os.Parcelable {
    ctor public SipMessage(@NonNull String, @NonNull String, @NonNull byte[]);
    method public int describeContents();
    method @NonNull public byte[] getContent();
    method @NonNull public String getHeaderSection();
    method @NonNull public String getStartLine();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.SipMessage> CREATOR;
  }
  }
}
}
@@ -11308,6 +11462,19 @@ package android.telephony.ims.feature {
package android.telephony.ims.stub {
package android.telephony.ims.stub {
  public interface DelegateConnectionMessageCallback {
    method public void onMessageReceived(@NonNull android.telephony.ims.SipMessage);
    method public void onMessageSendFailure(@NonNull String, int);
    method public void onMessageSent(@NonNull String);
  }
  public interface DelegateConnectionStateCallback {
    method public void onCreated(@NonNull android.telephony.ims.SipDelegateConnection);
    method public void onDestroyed(int);
    method public void onFeatureTagStatusChanged(@NonNull android.telephony.ims.DelegateRegistrationState, @NonNull java.util.Set<android.telephony.ims.FeatureTagState>);
    method public void onImsConfigurationChanged(@NonNull android.telephony.ims.SipDelegateImsConfiguration);
  }
  public class ImsCallSessionImplBase implements java.lang.AutoCloseable {
  public class ImsCallSessionImplBase implements java.lang.AutoCloseable {
    ctor public ImsCallSessionImplBase();
    ctor public ImsCallSessionImplBase();
    method public void accept(int, android.telephony.ims.ImsStreamMediaProfile);
    method public void accept(int, android.telephony.ims.ImsStreamMediaProfile);
@@ -11468,8 +11635,17 @@ package android.telephony.ims.stub {
    method public int updateColr(int);
    method public int updateColr(int);
  }
  }
  public interface SipDelegate {
    method public void closeDialog(@NonNull String);
    method public void notifyMessageReceiveError(@NonNull String, int);
    method public void notifyMessageReceived(@NonNull String);
    method public void sendMessage(@NonNull android.telephony.ims.SipMessage, long);
  }
  public class SipTransportImplBase {
  public class SipTransportImplBase {
    ctor public SipTransportImplBase(@NonNull java.util.concurrent.Executor);
    ctor public SipTransportImplBase(@NonNull java.util.concurrent.Executor);
    method public void createSipDelegate(int, @NonNull android.telephony.ims.DelegateRequest, @NonNull android.telephony.ims.DelegateStateCallback, @NonNull android.telephony.ims.DelegateMessageCallback);
    method public void destroySipDelegate(@NonNull android.telephony.ims.stub.SipDelegate, int);
  }
  }
}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
package android.telephony.ims;
package android.telephony.ims;


import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.telephony.ims.stub.SipDelegate;
import android.telephony.ims.stub.SipDelegate;


/**
/**
@@ -30,6 +31,7 @@ import android.telephony.ims.stub.SipDelegate;
 * </ul>
 * </ul>
 * @hide
 * @hide
 */
 */
@SystemApi
public interface DelegateMessageCallback {
public interface DelegateMessageCallback {


    /**
    /**
+24 −30
Original line number Original line Diff line number Diff line
@@ -18,14 +18,14 @@ package android.telephony.ims;


import android.annotation.IntDef;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable;
import android.util.ArraySet;
import android.util.ArraySet;


import java.lang.annotation.Retention;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Objects;
import java.util.Set;
import java.util.Set;


@@ -34,6 +34,7 @@ import java.util.Set;
 * ImsService.
 * ImsService.
 * @hide
 * @hide
 */
 */
@SystemApi
public final class DelegateRegistrationState implements Parcelable {
public final class DelegateRegistrationState implements Parcelable {


    /**
    /**
@@ -114,14 +115,14 @@ public final class DelegateRegistrationState implements Parcelable {
    })
    })
    public @interface DeregisteringReason {}
    public @interface DeregisteringReason {}


    private final ArrayList<String> mRegisteredTags = new ArrayList<>();
    private ArraySet<String> mRegisteredTags = new ArraySet<>();
    private final ArrayList<FeatureTagState> mDeregisteringTags = new ArrayList<>();
    private final ArraySet<FeatureTagState> mDeregisteringTags = new ArraySet<>();
    private final ArrayList<FeatureTagState> mDeregisteredTags = new ArrayList<>();
    private final ArraySet<FeatureTagState> mDeregisteredTags = new ArraySet<>();


    /**
    /**
     * Builder used to create new instances of {@link DelegateRegistrationState}.
     * Builder used to create new instances of {@link DelegateRegistrationState}.
     */
     */
    public static class Builder {
    public static final class Builder {


        private final DelegateRegistrationState mState;
        private final DelegateRegistrationState mState;


@@ -135,10 +136,8 @@ public final class DelegateRegistrationState implements Parcelable {
         * @param featureTag The IMS media feature tag included in the current IMS registration.
         * @param featureTag The IMS media feature tag included in the current IMS registration.
         * @return The in-progress Builder instance for RegistrationState.
         * @return The in-progress Builder instance for RegistrationState.
         */
         */
        public Builder addRegisteredFeatureTag(@NonNull String featureTag) {
        public @NonNull Builder addRegisteredFeatureTag(@NonNull String featureTag) {
            if (!mState.mRegisteredTags.contains(featureTag)) {
            mState.mRegisteredTags.add(featureTag);
            mState.mRegisteredTags.add(featureTag);
            }
            return this;
            return this;
        }
        }


@@ -148,7 +147,8 @@ public final class DelegateRegistrationState implements Parcelable {
         * @param featureTags The IMS media feature tags included in the current IMS registration.
         * @param featureTags The IMS media feature tags included in the current IMS registration.
         * @return The in-progress Builder instance for RegistrationState.
         * @return The in-progress Builder instance for RegistrationState.
         */
         */
        public Builder addRegisteredFeatureTags(@NonNull Set<String> featureTags) {
        @SuppressLint("MissingGetterMatchingBuilder")
        public @NonNull Builder addRegisteredFeatureTags(@NonNull Set<String> featureTags) {
            mState.mRegisteredTags.addAll(featureTags);
            mState.mRegisteredTags.addAll(featureTags);
            return this;
            return this;
        }
        }
@@ -167,13 +167,9 @@ public final class DelegateRegistrationState implements Parcelable {
         *         The availability of the feature tag depends on the {@link DeregisteringReason}.
         *         The availability of the feature tag depends on the {@link DeregisteringReason}.
         * @return The in-progress Builder instance for RegistrationState.
         * @return The in-progress Builder instance for RegistrationState.
         */
         */
        public Builder addDeregisteringFeatureTag(@NonNull String featureTag,
        public @NonNull Builder addDeregisteringFeatureTag(@NonNull String featureTag,
                @DeregisteringReason int reason) {
                @DeregisteringReason int reason) {
            boolean ftExists = mState.mDeregisteringTags.stream().anyMatch(
                    f -> f.getFeatureTag().equals(featureTag));
            if (!ftExists) {
            mState.mDeregisteringTags.add(new FeatureTagState(featureTag, reason));
            mState.mDeregisteringTags.add(new FeatureTagState(featureTag, reason));
            }
            return this;
            return this;
        }
        }


@@ -185,20 +181,16 @@ public final class DelegateRegistrationState implements Parcelable {
         * @param reason The reason why the media feature tag has been deregistered.
         * @param reason The reason why the media feature tag has been deregistered.
         * @return The in-progress Builder instance for RegistrationState.
         * @return The in-progress Builder instance for RegistrationState.
         */
         */
        public Builder addDeregisteredFeatureTag(@NonNull String featureTag,
        public @NonNull Builder addDeregisteredFeatureTag(@NonNull String featureTag,
                @DeregisteredReason int reason) {
                @DeregisteredReason int reason) {
            boolean ftExists = mState.mDeregisteredTags.stream().anyMatch(
                    f -> f.getFeatureTag().equals(featureTag));
            if (!ftExists) {
            mState.mDeregisteredTags.add(new FeatureTagState(featureTag, reason));
            mState.mDeregisteredTags.add(new FeatureTagState(featureTag, reason));
            }
            return this;
            return this;
        }
        }


        /**
        /**
         * @return the finalized instance.
         * @return the finalized instance.
         */
         */
        public DelegateRegistrationState build() {
        public @NonNull DelegateRegistrationState build() {
            return mState;
            return mState;
        }
        }
    }
    }
@@ -212,7 +204,7 @@ public final class DelegateRegistrationState implements Parcelable {
     * Used for unparcelling only.
     * Used for unparcelling only.
     */
     */
    private DelegateRegistrationState(Parcel source) {
    private DelegateRegistrationState(Parcel source) {
        source.readList(mRegisteredTags, null /*classloader*/);
        mRegisteredTags = (ArraySet<String>) source.readArraySet(null);
        readStateFromParcel(source, mDeregisteringTags);
        readStateFromParcel(source, mDeregisteringTags);
        readStateFromParcel(source, mDeregisteredTags);
        readStateFromParcel(source, mDeregisteredTags);
    }
    }
@@ -268,7 +260,8 @@ public final class DelegateRegistrationState implements Parcelable {
        return new ArraySet<>(mDeregisteredTags);
        return new ArraySet<>(mDeregisteredTags);
    }
    }


    public static final Creator<DelegateRegistrationState> CREATOR =

    public static final @NonNull Creator<DelegateRegistrationState> CREATOR =
            new Creator<DelegateRegistrationState>() {
            new Creator<DelegateRegistrationState>() {
        @Override
        @Override
        public DelegateRegistrationState createFromParcel(Parcel source) {
        public DelegateRegistrationState createFromParcel(Parcel source) {
@@ -287,13 +280,13 @@ public final class DelegateRegistrationState implements Parcelable {
    }
    }


    @Override
    @Override
    public void writeToParcel(Parcel dest, int flags) {
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeList(mRegisteredTags);
        dest.writeArraySet(mRegisteredTags);
        writeStateToParcel(dest, mDeregisteringTags);
        writeStateToParcel(dest, mDeregisteringTags);
        writeStateToParcel(dest, mDeregisteredTags);
        writeStateToParcel(dest, mDeregisteredTags);
    }
    }


    private void writeStateToParcel(Parcel dest, List<FeatureTagState> state) {
    private void writeStateToParcel(Parcel dest, Set<FeatureTagState> state) {
        dest.writeInt(state.size());
        dest.writeInt(state.size());
        for (FeatureTagState s : state) {
        for (FeatureTagState s : state) {
            dest.writeString(s.getFeatureTag());
            dest.writeString(s.getFeatureTag());
@@ -301,11 +294,12 @@ public final class DelegateRegistrationState implements Parcelable {
        }
        }
    }
    }


    private void readStateFromParcel(Parcel source, List<FeatureTagState> emptyState) {
    private void readStateFromParcel(Parcel source, Set<FeatureTagState> emptyState) {
        int len = source.readInt();
        int len = source.readInt();
        for (int i = 0; i < len; i++) {
        for (int i = 0; i < len; i++) {
            String ft = source.readString();
            String ft = source.readString();
            int reason = source.readInt();
            int reason = source.readInt();

            emptyState.add(new FeatureTagState(ft, reason));
            emptyState.add(new FeatureTagState(ft, reason));
        }
        }
    }
    }
+4 −2
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
package android.telephony.ims;
package android.telephony.ims;


import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable;
import android.telephony.ims.stub.SipDelegate;
import android.telephony.ims.stub.SipDelegate;
@@ -31,6 +32,7 @@ import java.util.Set;
 * SipDelegateConnection given back to the requesting application.
 * SipDelegateConnection given back to the requesting application.
 * @hide
 * @hide
 */
 */
@SystemApi
public final class DelegateRequest implements Parcelable {
public final class DelegateRequest implements Parcelable {


    private final ArrayList<String> mFeatureTags;
    private final ArrayList<String> mFeatureTags;
@@ -52,7 +54,7 @@ public final class DelegateRequest implements Parcelable {
     * @return the list of IMS feature tag associated with this DelegateRequest in the format
     * @return the list of IMS feature tag associated with this DelegateRequest in the format
     * defined in RCC.07 section 2.6.1.3.
     * defined in RCC.07 section 2.6.1.3.
     */
     */
    public Set<String> getFeatureTags() {
    public @NonNull Set<String> getFeatureTags() {
        return new ArraySet<>(mFeatureTags);
        return new ArraySet<>(mFeatureTags);
    }
    }


@@ -70,7 +72,7 @@ public final class DelegateRequest implements Parcelable {
    }
    }


    @Override
    @Override
    public void writeToParcel(Parcel dest, int flags) {
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeList(mFeatureTags);
        dest.writeList(mFeatureTags);
    }
    }


+7 −8
Original line number Original line Diff line number Diff line
@@ -18,10 +18,11 @@ package android.telephony.ims;


import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.telephony.ims.stub.SipDelegate;
import android.telephony.ims.stub.SipDelegate;
import android.telephony.ims.stub.SipTransportImplBase;
import android.telephony.ims.stub.SipTransportImplBase;


import java.util.List;
import java.util.Set;


/**
/**
 * Callback interface to notify a remote application of the following:
 * Callback interface to notify a remote application of the following:
@@ -34,26 +35,24 @@ import java.util.List;
 * </ul>
 * </ul>
 * @hide
 * @hide
 */
 */
@SystemApi
public interface DelegateStateCallback {
public interface DelegateStateCallback {


    /**
    /**
     * This must be called by the ImsService after {@link SipTransportImplBase#createSipDelegate} is
     * This must be called by the ImsService after {@link SipTransportImplBase#createSipDelegate} is
     * called by the framework to notify the framework and remote application that the
     * called by the framework to notify the framework and remote application that the
     * {@link SipDelegate} has been successfully created.
     * {@link SipDelegate} has been successfully created.
     *
     *  @param delegate The SipDelegate created to service the DelegateRequest.
     *  @param delegate The SipDelegate created to service the DelegateRequest.
     * @param deniedTags A List of {@link FeatureTagState}, which contains the feature tags
     * @param deniedTags A Set of {@link FeatureTagState}s, which contain the feature tags
     *    associated with this {@link SipDelegate} that have no access to send/receive SIP messages
     *    associated with this {@link SipDelegate} that have no access to send/receive SIP messages
     *    as well as a reason for why the feature tag is denied. For more information on the reason
     *    as well as a reason for why the feature tag is denied. For more information on the reason
     *    why the feature tag was denied access, see the
     *    why the feature tag was denied access, see the
     *    {@link SipDelegateManager.DeniedReason} reasons. This is considered a permanent denial due
     *    {@link SipDelegateManager.DeniedReason} reasons. This is considered a permanent denial due
     *    to this {@link SipDelegate} not supporting a feature or this ImsService already
     *    to this {@link SipDelegate} not supporting a feature or this ImsService already
     *    implementing this feature elsewhere. If all features of this {@link SipDelegate} are
     *    implementing this feature elsewhere. If all features of this {@link SipDelegate} are
     *    denied, {@link #onCreated(SipDelegate, List)} should still be called as the framework will
     *    denied, this method should still be called.
     *    later call {@link SipTransportImplBase#destroySipDelegate(SipDelegate, int)} to clean the
     *    delegate up.
     */
     */
    void onCreated(@NonNull SipDelegate delegate, @Nullable List<FeatureTagState> deniedTags);
    void onCreated(@NonNull SipDelegate delegate, @Nullable Set<FeatureTagState> deniedTags);


    /**
    /**
     * This must be called by the ImsService after the framework calls
     * This must be called by the ImsService after the framework calls
Loading