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

Commit a1474266 authored by Brad Ebinger's avatar Brad Ebinger Committed by Gerrit Code Review
Browse files

Merge "ImsSsData needs a public constructor for vendors to use"

parents 94fe6430 4123f958
Loading
Loading
Loading
Loading
+63 −2
Original line number Diff line number Diff line
@@ -5632,7 +5632,18 @@ package android.telephony.ims {
    method public int getTimeSeconds();
    method public int getToA();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CDIV_CF_REASON_ALL = 4; // 0x4
    field public static final int CDIV_CF_REASON_ALL_CONDITIONAL = 5; // 0x5
    field public static final int CDIV_CF_REASON_BUSY = 1; // 0x1
    field public static final int CDIV_CF_REASON_NOT_LOGGED_IN = 6; // 0x6
    field public static final int CDIV_CF_REASON_NOT_REACHABLE = 3; // 0x3
    field public static final int CDIV_CF_REASON_NO_REPLY = 2; // 0x2
    field public static final int CDIV_CF_REASON_UNCONDITIONAL = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsCallForwardInfo> CREATOR;
    field public static final int STATUS_ACTIVE = 1; // 0x1
    field public static final int STATUS_NOT_ACTIVE = 0; // 0x0
    field public static final int TYPE_OF_ADDRESS_INTERNATIONAL = 145; // 0x91
    field public static final int TYPE_OF_ADDRESS_UNKNOWN = 129; // 0x81
  }

  public final class ImsCallProfile implements android.os.Parcelable {
@@ -5967,6 +5978,13 @@ package android.telephony.ims {
  public final class ImsSsData implements android.os.Parcelable {
    ctor public ImsSsData(int, int, int, int, int);
    method public int describeContents();
    method public android.telephony.ims.ImsCallForwardInfo[] getCallForwardInfo();
    method public int getRequestType();
    method public int getResult();
    method public int getServiceClass();
    method public int getServiceType();
    method public android.telephony.ims.ImsSsInfo[] getSuppServiceInfo();
    method public int getTeleserviceType();
    method public boolean isTypeBarring();
    method public boolean isTypeCf();
    method public boolean isTypeClip();
@@ -5979,6 +5997,16 @@ package android.telephony.ims {
    method public boolean isTypeUnConditional();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSsData> CREATOR;
    field public static final int RESULT_SUCCESS = 0; // 0x0
    field public static final int SERVICE_CLASS_DATA = 2; // 0x2
    field public static final int SERVICE_CLASS_DATA_CIRCUIT_ASYNC = 32; // 0x20
    field public static final int SERVICE_CLASS_DATA_CIRCUIT_SYNC = 16; // 0x10
    field public static final int SERVICE_CLASS_DATA_PACKET_ACCESS = 64; // 0x40
    field public static final int SERVICE_CLASS_DATA_PAD = 128; // 0x80
    field public static final int SERVICE_CLASS_FAX = 4; // 0x4
    field public static final int SERVICE_CLASS_NONE = 0; // 0x0
    field public static final int SERVICE_CLASS_SMS = 8; // 0x8
    field public static final int SERVICE_CLASS_VOICE = 1; // 0x1
    field public static final int SS_ACTIVATION = 0; // 0x0
    field public static final int SS_ALL_BARRING = 18; // 0x12
    field public static final int SS_ALL_DATA_TELESERVICES = 3; // 0x3
@@ -6015,13 +6043,31 @@ package android.telephony.ims {
    field public static final int SS_WAIT = 12; // 0xc
  }

  public static class ImsSsData.Builder {
    ctor public ImsSsData.Builder(int, int, int, int, int);
    method public android.telephony.ims.ImsSsData build();
    method public android.telephony.ims.ImsSsData.Builder setCallForwardingInfo(android.telephony.ims.ImsCallForwardInfo[]);
    method public android.telephony.ims.ImsSsData.Builder setSuppServiceInfo(android.telephony.ims.ImsSsInfo[]);
  }

  public final class ImsSsInfo implements android.os.Parcelable {
    ctor public ImsSsInfo(int, java.lang.String);
    ctor public deprecated ImsSsInfo(int, java.lang.String);
    method public int describeContents();
    method public java.lang.String getIcbNum();
    method public int getClirInterrogationStatus();
    method public int getClirOutgoingState();
    method public deprecated java.lang.String getIcbNum();
    method public java.lang.String getIncomingCommunicationBarringNumber();
    method public int getProvisionStatus();
    method public int getStatus();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CLIR_OUTGOING_DEFAULT = 0; // 0x0
    field public static final int CLIR_OUTGOING_INVOCATION = 1; // 0x1
    field public static final int CLIR_OUTGOING_SUPPRESSION = 2; // 0x2
    field public static final int CLIR_STATUS_NOT_PROVISIONED = 0; // 0x0
    field public static final int CLIR_STATUS_PROVISIONED_PERMANENT = 1; // 0x1
    field public static final int CLIR_STATUS_TEMPORARILY_ALLOWED = 4; // 0x4
    field public static final int CLIR_STATUS_TEMPORARILY_RESTRICTED = 3; // 0x3
    field public static final int CLIR_STATUS_UNKNOWN = 2; // 0x2
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSsInfo> CREATOR;
    field public static final int DISABLED = 0; // 0x0
    field public static final int ENABLED = 1; // 0x1
@@ -6031,6 +6077,21 @@ package android.telephony.ims {
    field public static final int SERVICE_PROVISIONING_UNKNOWN = -1; // 0xffffffff
  }

  public static class ImsSsInfo.Builder {
    ctor public ImsSsInfo.Builder(int);
    method public android.telephony.ims.ImsSsInfo build();
    method public android.telephony.ims.ImsSsInfo.Builder setClirInterrogationStatus(int);
    method public android.telephony.ims.ImsSsInfo.Builder setClirOutgoingState(int);
    method public android.telephony.ims.ImsSsInfo.Builder setIncomingCommunicationBarringNumber(java.lang.String);
    method public android.telephony.ims.ImsSsInfo.Builder setProvisionStatus(int);
  }

  public static abstract class ImsSsInfo.ClirInterrogationStatus implements java.lang.annotation.Annotation {
  }

  public static abstract class ImsSsInfo.ClirOutgoingState implements java.lang.annotation.Annotation {
  }

  public final class ImsStreamMediaProfile implements android.os.Parcelable {
    ctor public ImsStreamMediaProfile(int, int, int, int, int);
    method public void copyFrom(android.telephony.ims.ImsStreamMediaProfile);
+133 −25
Original line number Diff line number Diff line
@@ -16,11 +16,16 @@

package android.telephony.ims;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.os.Parcelable;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Provides the call forward information for the supplementary service configuration.
 *
@@ -28,39 +33,120 @@ import android.os.Parcelable;
 */
@SystemApi
public final class ImsCallForwardInfo implements Parcelable {
    // Refer to ImsUtInterface#CDIV_CF_XXX

    /**
     * CDIV (Communication Diversion, 3GPP TS 24.604) call forwarding reason for unconditional call
     * forwarding. See TC 27.007
     */
    public static final int CDIV_CF_REASON_UNCONDITIONAL = 0;

    /**
     * CDIV (Communication Diversion, 3GPP TS 24.604) call forwarding reason for call forwarding
     * when the user is busy.
     */
    public static final int CDIV_CF_REASON_BUSY = 1;

    /**
     * CDIV (Communication Diversion, 3GPP TS 24.604) call forwarding reason for call forwarding
     * when there is no reply from the user.
     */
    public static final int CDIV_CF_REASON_NO_REPLY = 2;

    /**
     * CDIV (Communication Diversion, 3GPP TS 24.604) call forwarding reason for call forwarding
     * when the user is not reachable.
     */
    public static final int CDIV_CF_REASON_NOT_REACHABLE = 3;

    /**
     * CDIV (Communication Diversion, 3GPP TS 24.604) call forwarding reason for setting all call
     * forwarding reasons simultaneously (i.e. unconditional, busy, no reply, and not reachable).
     */
    public static final int CDIV_CF_REASON_ALL = 4;

    /**
     * CDIV (Communication Diversion, 3GPP TS 24.604) call forwarding reason for setting all
     * conditional call forwarding reasons simultaneously (i.e. if busy, if no reply, and if not
     * reachable).
     */
    public static final int CDIV_CF_REASON_ALL_CONDITIONAL = 5;

    /**
     * CDIV (Communication Diversion) IMS only call forwarding reason for call forwarding when the
     * user is not logged in.
     */
    public static final int CDIV_CF_REASON_NOT_LOGGED_IN = 6;

    /**@hide*/
    @IntDef(prefix = {"CDIV_CF_REASON_"}, value = {
            CDIV_CF_REASON_UNCONDITIONAL,
            CDIV_CF_REASON_BUSY,
            CDIV_CF_REASON_NO_REPLY,
            CDIV_CF_REASON_NOT_REACHABLE,
            CDIV_CF_REASON_ALL,
            CDIV_CF_REASON_ALL_CONDITIONAL,
            CDIV_CF_REASON_NOT_LOGGED_IN})
    @Retention(RetentionPolicy.SOURCE)
    public @interface CallForwardReasons{}

    /**
     * Call forwarding is not active for any service class.
     */
    public static final int STATUS_NOT_ACTIVE = 0;

    /**
     * Call forwarding is active for one or more service classes.
     */
    public static final int STATUS_ACTIVE = 1;

    /**@hide*/
    @IntDef(prefix = {"STATUS_"}, value = {
            STATUS_NOT_ACTIVE,
            STATUS_ACTIVE})
    @Retention(RetentionPolicy.SOURCE)
    public @interface CallForwardStatus{}

    /**
     * The address defined in {@link #getNumber()} is in an unknown format.
     *
     * See TS 27.007, section 7.11 for more information.
     */
    public static final int TYPE_OF_ADDRESS_UNKNOWN = 0x81;
    /**
     * The address defined in {@link #getNumber()} is in E.164 international format, which includes
     * international access code "+".
     *
     * See TS 27.007, section 7.11 for more information.
     */
    public static final int TYPE_OF_ADDRESS_INTERNATIONAL = 0x91;

    /**@hide*/
    @IntDef(prefix = {"TYPE_OF_ADDRESS_"}, value = {
            TYPE_OF_ADDRESS_INTERNATIONAL,
            TYPE_OF_ADDRESS_UNKNOWN})
    @Retention(RetentionPolicy.SOURCE)
    public @interface TypeOfAddress{}

    /**@hide*/
    // TODO: Make private, do not modify this field directly, use getter.
    @UnsupportedAppUsage
    public int mCondition;
    // 0: disabled, 1: enabled
    public @CallForwardReasons int mCondition;
    /** @hide */
    // TODO: Make private, do not modify this field directly, use getter.
    @UnsupportedAppUsage
    public int mStatus;
    // 0x91: International, 0x81: Unknown
    public @CallForwardStatus int mStatus;
    /** @hide */
    // TODO: Make private, do not modify this field directly, use getter.
    @UnsupportedAppUsage
    public int mToA;
    // Service class
    public @TypeOfAddress int mToA;
    /** @hide */
    // TODO: Make private, do not modify this field directly, use getter.
    @UnsupportedAppUsage
    public int mServiceClass;
    // Number (it will not include the "sip" or "tel" URI scheme)
    public @ImsSsData.ServiceClassFlags int mServiceClass;
    /** @hide */
    // TODO: Make private, do not modify this field directly, use getter.
    @UnsupportedAppUsage
    public String mNumber;
    // No reply timer for CF
    /** @hide */
    // TODO: Make private, do not modify this field directly, use getter.
    @UnsupportedAppUsage
    public int mTimeSeconds;

    /** @hide */
    // TODO: Will be removed in the future, use public constructor instead.
    @UnsupportedAppUsage
    public ImsCallForwardInfo() {
    }
@@ -68,9 +154,10 @@ public final class ImsCallForwardInfo implements Parcelable {
    /**
     * IMS Call Forward Information.
     */
    public ImsCallForwardInfo(int condition, int status, int toA, int serviceClass, String number,
            int replyTimerSec) {
        mCondition = condition;
    public ImsCallForwardInfo(@CallForwardReasons int reason, @CallForwardStatus int status,
            @TypeOfAddress int toA, @ImsSsData.ServiceClassFlags int serviceClass,
            @NonNull String number, int replyTimerSec) {
        mCondition = reason;
        mStatus = status;
        mToA = toA;
        mServiceClass = serviceClass;
@@ -130,26 +217,47 @@ public final class ImsCallForwardInfo implements Parcelable {
        }
    };

    public int getCondition() {
    /**
     * @return the condition of call forwarding for the service classes specified.
     */
    public @CallForwardReasons int getCondition() {
        return mCondition;
    }

    public int getStatus() {
    /**
     * @return The call forwarding status.
     */
    public @CallForwardStatus int getStatus() {
        return mStatus;
    }

    public int getToA() {
    /**
     * @return the type of address (ToA) for the number.
     * @see #getNumber()
     */
    public @TypeOfAddress int getToA() {
        return mToA;
    }

    public int getServiceClass() {
    /**
     * @return a bitfield containing the service classes that are enabled for call forwarding.
     */
    public @ImsSsData.ServiceClassFlags int getServiceClass() {
        return mServiceClass;
    }

    /**
     * @return the call forwarding number associated with call forwarding, with a number type
     * defined by {@link #getToA()}.
     */
    public String getNumber() {
        return mNumber;
    }

    /**
     * @return the number in seconds to wait before the call is forwarded for call forwarding
     * condition {@link #CDIV_CF_REASON_NO_REPLY}
     */
    public int getTimeSeconds() {
        return mTimeSeconds;
    }
+288 −157

File changed.

Preview size limit exceeded, changes collapsed.

+182 −24
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package android.telephony.ims;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
@@ -28,10 +30,24 @@ import java.lang.annotation.RetentionPolicy;
/**
 * Provides the result to the update operation for the supplementary service configuration.
 *
 * Also supports IMS specific Incoming Communication Barring (ICB) as well as Anonymous
 * Communication Rejection (ACR), as per 3GPP 24.611.
 *
 * @see Builder
 * @hide
 */
@SystemApi
public final class ImsSsInfo implements Parcelable {

    /**@hide*/
    @IntDef(value = {
            NOT_REGISTERED,
            DISABLED,
            ENABLED
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ServiceStatus {}

    /**
     * For the status of service registration or activation/deactivation.
     */
@@ -40,57 +56,180 @@ public final class ImsSsInfo implements Parcelable {
    public static final int ENABLED = 1;

    /**
     * Provision status of service
     * Provision status of service.
     * @hide
     */
    /** @hide */
    @IntDef({
    @IntDef(value = {
            SERVICE_PROVISIONING_UNKNOWN,
            SERVICE_NOT_PROVISIONED,
            SERVICE_PROVISIONED
    })
    }, prefix = "SERVICE_")
    @Retention(RetentionPolicy.SOURCE)
    public @interface ServiceProvisionStatus {}

    /**
     * Unknown provision status for the service.
     */
    public static final int SERVICE_PROVISIONING_UNKNOWN = (-1);

    /**
     * Service is not provisioned.
     */
    public static final int SERVICE_NOT_PROVISIONED = 0;

    /**
     * Service is provisioned.
     */
    public static final int SERVICE_PROVISIONED = 1;

    @IntDef(value = {
            CLIR_OUTGOING_DEFAULT,
            CLIR_OUTGOING_INVOCATION,
            CLIR_OUTGOING_SUPPRESSION
    }, prefix = "CLIR_OUTGOING_")
    @Retention(RetentionPolicy.SOURCE)
    public @interface ClirOutgoingState {}

    /**
     * Calling line identification restriction (CLIR) is set to the default according to the
     * subscription of the CLIR service.
     *
     * See TS 27.007, section 7.7 for more information.
     */
    public static final int CLIR_OUTGOING_DEFAULT = 0;
    /**
     * Activate Calling line identification restriction for outgoing calls.
     *
     * See TS 27.007, section 7.7 for more information.
     */
    public static final int CLIR_OUTGOING_INVOCATION = 1;
    /**
     * Deactivate Calling line identification restriction for outgoing calls.
     *
     * See TS 27.007, section 7.7 for more information.
     */
    public static final int CLIR_OUTGOING_SUPPRESSION = 2;

    /**
     * Calling line identification restriction is currently not provisioned.
     *
     * See TS 27.007, section 7.7 for more information.
     */
    public static final int CLIR_STATUS_NOT_PROVISIONED = 0;
    /**
     * Calling line identification restriction is currently provisioned in permanent mode.
     *
     * See TS 27.007, section 7.7 for more information.
     */
    public static final int CLIR_STATUS_PROVISIONED_PERMANENT = 1;
    /**
     * Calling line identification restriction is currently unknown, e.g. no network, etc.
     *
     * See TS 27.007, section 7.7 for more information.
     */
    public static final int CLIR_STATUS_UNKNOWN = 2;
    /**
     * Calling line identification restriction temporary mode, temporarily restricted.
     *
     * See TS 27.007, section 7.7 for more information.
     */
    public static final int CLIR_STATUS_TEMPORARILY_RESTRICTED = 3;
    /**
     * Calling line identification restriction temporary mode, temporarily allowed.
     *
     * See TS 27.007, section 7.7 for more information.
     */
    public static final int CLIR_STATUS_TEMPORARILY_ALLOWED = 4;

    @IntDef(value = {
            CLIR_STATUS_NOT_PROVISIONED,
            CLIR_STATUS_PROVISIONED_PERMANENT,
            CLIR_STATUS_UNKNOWN,
            CLIR_STATUS_TEMPORARILY_RESTRICTED,
            CLIR_STATUS_TEMPORARILY_ALLOWED
    }, prefix = "CLIR_STATUS_")
    @Retention(RetentionPolicy.SOURCE)
    public @interface ClirInterrogationStatus {}

    // 0: disabled, 1: enabled
    /** @hide */
    // TODO: Make private, do not modify this field directly, use getter!
    @UnsupportedAppUsage
    public int mStatus;
    /** @hide */
    // TODO: Make private, do not modify this field directly, use getter!
    @UnsupportedAppUsage
    public String mIcbNum;
    /** @hide */
    public int mProvisionStatus = SERVICE_PROVISIONING_UNKNOWN;
    private int mClirInterrogationStatus = CLIR_STATUS_UNKNOWN;
    private int mClirOutgoingState = CLIR_OUTGOING_DEFAULT;

    /**@hide*/
    // TODO: Remove! Do not use this constructor, instead use public version.
    @UnsupportedAppUsage
    public ImsSsInfo() {
    }

    /**
     * Builds {@link ImsSsInfo} instances, which may include optional parameters.
     */
    public static class Builder {

        private final ImsSsInfo mImsSsInfo;

        public Builder(@ServiceStatus int status) {
            mImsSsInfo = new ImsSsInfo();
            mImsSsInfo.mStatus = status;
        }

        /**
         * Set the ICB number for IMS call barring.
         * @param number The number in E.164 international format.
         */
        public Builder setIncomingCommunicationBarringNumber(@NonNull String number) {
            mImsSsInfo.mIcbNum = number;
            return this;
        }

        /**
         * Set the provisioning status for a Supplementary Service interrogation response.
         */
        public Builder setProvisionStatus(@ServiceProvisionStatus int provisionStatus) {
            mImsSsInfo.mProvisionStatus = provisionStatus;
            return this;
        }

        /**
         * Set the Calling Line Identification Restriction (CLIR) status for a supplementary service
         * interrogation response.
         */
        public Builder setClirInterrogationStatus(@ClirInterrogationStatus int status) {
            mImsSsInfo.mClirInterrogationStatus = status;
            return this;
        }

        /**
         * Set the Calling line identification Restriction (CLIR) state for outgoing calls.
         */
        public Builder setClirOutgoingState(@ClirOutgoingState int state) {
            mImsSsInfo.mClirOutgoingState = state;
            return this;
        }

        /**
         * @return a built {@link ImsSsInfo} containing optional the parameters that were set.
         */
        public ImsSsInfo build() {
            return mImsSsInfo;
        }
    }

    /**
     *
     * @param status The status of the service registration of activation/deactiviation. Valid
     *    entries include:
     *    {@link #NOT_REGISTERED},
     *    {@link #DISABLED},
     *    {@link #ENABLED}
     * @param status The status of the service registration of activation/deactiviation.
     * @param icbNum The Incoming barring number.
     * @deprecated use {@link ImsSsInfo.Builder} instead.
     */
    public ImsSsInfo(int status, String icbNum) {
    @Deprecated
    public ImsSsInfo(@ServiceStatus int status, @Nullable String icbNum) {
        mStatus = status;
        mIcbNum = icbNum;
    }
@@ -148,27 +287,46 @@ public final class ImsSsInfo implements Parcelable {
    };

    /**
     * @return Supplementary Service Configuration status. Valid Values are:
     *     {@link #NOT_REGISTERED},
     *     {@link #DISABLED},
     *     {@link #ENABLED}
     * @return Supplementary Service Configuration status.
     */
    public int getStatus() {
    public @ServiceStatus int getStatus() {
        return mStatus;
    }

    /** @deprecated Use {@link #getIncomingCommunicationBarringNumber()} instead.*/
    @Deprecated
    public String getIcbNum() {
        return mIcbNum;
    }

    /**
     * @return Supplementary Service Provision status. Valid Values are:
     *     {@link #SERVICE_PROVISIONING_UNKNOWN},
     *     {@link #SERVICE_NOT_PROVISIONED},
     *     {@link #SERVICE_PROVISIONED}
     * @return The Incoming Communication Barring (ICB) number.
     */
    public String getIncomingCommunicationBarringNumber() {
        return mIcbNum;
    }

    /**
     * @return Supplementary Service Provision status.
     */
    @ServiceProvisionStatus
    public int getProvisionStatus() {
    public @ServiceProvisionStatus int getProvisionStatus() {
        return mProvisionStatus;
    }

    /**
     * @return the Calling Line Identification Restriction State for outgoing calls with respect to
     * this subscription. Will be {@link #CLIR_OUTGOING_DEFAULT} if not applicable to this SS info.
     */
    public @ClirOutgoingState int getClirOutgoingState() {
        return mClirOutgoingState;
    }

    /**
     * @return the calling line identification restriction provisioning status upon interrogation of
     * the service for this subscription. Will be {@link #CLIR_STATUS_UNKNOWN} if not applicable to
     * this SS info.
     */
    public @ClirInterrogationStatus int getClirInterrogationStatus() {
        return mClirInterrogationStatus;
    }
}