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

Commit b4094993 authored by Jack Yu's avatar Jack Yu
Browse files

Added documentation for network registration state

Also renamed denial reason to reject cause to match
the 3GPP spec.

Bug: 73659459
Test: Build
Change-Id: Ia7b4a53070c06edd98ae767fd6f56c4000d8e4d0
parent c1e5c3ea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4274,8 +4274,8 @@ package android.telephony {
    method public int[] getAvailableServices();
    method public android.telephony.CellIdentity getCellIdentity();
    method public int getDomain();
    method public int getReasonForDenial();
    method public int getRegState();
    method public int getRejectCause();
    method public int getTransportType();
    method public boolean isEmergencyEnabled();
    method public void writeToParcel(android.os.Parcel, int);
+58 −41
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.AccessNetworkConstants.TransportType;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -88,7 +89,7 @@ public class NetworkRegistrationState implements Parcelable {
    @Domain
    private final int mDomain;

    /** {@link AccessNetworkConstants.TransportType}*/
    /** {@link TransportType} */
    private final int mTransportType;

    @RegState
@@ -96,7 +97,7 @@ public class NetworkRegistrationState implements Parcelable {

    private final int mAccessNetworkTechnology;

    private final int mReasonForDenial;
    private final int mRejectCause;

    private final boolean mEmergencyOnly;

@@ -112,22 +113,35 @@ public class NetworkRegistrationState implements Parcelable {
    private DataSpecificRegistrationStates mDataSpecificStates;

    /**
     * @param domain Network domain. Must be DOMAIN_CS or DOMAIN_PS.
     * @param transportType Transport type. Must be {@link AccessNetworkConstants.TransportType}
     * @param regState Network registration state.
     * @param accessNetworkTechnology See TelephonyManager NETWORK_TYPE_XXXX.
     * @param reasonForDenial Reason for denial if the registration state is DENIED.
     * @param availableServices The supported service.
     * @param cellIdentity The identity representing a unique cell
     * @param domain Network domain. Must be a {@link Domain}. For {@link TransportType#WLAN}
     * transport, this must set to {@link #DOMAIN_PS}.
     * @param transportType Transport type. Must be one of the{@link TransportType}.
     * @param regState Network registration state. Must be one of the {@link RegState}. For
     * {@link TransportType#WLAN} transport, only {@link #REG_STATE_HOME} and
     * {@link #REG_STATE_NOT_REG_NOT_SEARCHING} are valid states.
     * @param accessNetworkTechnology Access network technology. Must be one of TelephonyManager
     * NETWORK_TYPE_XXXX. For {@link TransportType#WLAN} transport, set to
     * {@link TelephonyManager#NETWORK_TYPE_IWLAN}.
     * @param rejectCause Reason for denial if the registration state is {@link #REG_STATE_DENIED}.
     * Depending on {@code accessNetworkTechnology}, the values are defined in 3GPP TS 24.008
     * 10.5.3.6 for UMTS, 3GPP TS 24.301 9.9.3.9 for LTE, and 3GPP2 A.S0001 6.2.2.44 for CDMA. If
     * the reject cause is not supported or unknown, set it to 0.
     * // TODO: Add IWLAN reject cause reference
     * @param emergencyOnly True if this registration is for emergency only.
     * @param availableServices The list of the supported services. Each element must be one of
     * the {@link ServiceType}.
     * @param cellIdentity The identity representing a unique cell or wifi AP. Set to null if the
     * information is not available.
     */
    public NetworkRegistrationState(int domain, int transportType, int regState,
            int accessNetworkTechnology, int reasonForDenial, boolean emergencyOnly,
            int[] availableServices, @Nullable CellIdentity cellIdentity) {
    public NetworkRegistrationState(@Domain int domain, int transportType, @RegState int regState,
                                    int accessNetworkTechnology, int rejectCause,
                                    boolean emergencyOnly, int[] availableServices,
                                    @Nullable CellIdentity cellIdentity) {
        mDomain = domain;
        mTransportType = transportType;
        mRegState = regState;
        mAccessNetworkTechnology = accessNetworkTechnology;
        mReasonForDenial = reasonForDenial;
        mRejectCause = rejectCause;
        mAvailableServices = availableServices;
        mCellIdentity = cellIdentity;
        mEmergencyOnly = emergencyOnly;
@@ -138,11 +152,13 @@ public class NetworkRegistrationState implements Parcelable {
     * @hide
     */
    public NetworkRegistrationState(int domain, int transportType, int regState,
            int accessNetworkTechnology, int reasonForDenial, boolean emergencyOnly,
            int[] availableServices, @Nullable CellIdentity cellIdentity, boolean cssSupported,
            int roamingIndicator, int systemIsInPrl, int defaultRoamingIndicator) {
        this(domain, transportType, regState, accessNetworkTechnology,
                reasonForDenial, emergencyOnly, availableServices, cellIdentity);
                                    int accessNetworkTechnology, int rejectCause,
                                    boolean emergencyOnly, int[] availableServices,
                                    @Nullable CellIdentity cellIdentity, boolean cssSupported,
                                    int roamingIndicator, int systemIsInPrl,
                                    int defaultRoamingIndicator) {
        this(domain, transportType, regState, accessNetworkTechnology, rejectCause, emergencyOnly,
                availableServices, cellIdentity);

        mVoiceSpecificStates = new VoiceSpecificRegistrationStates(cssSupported, roamingIndicator,
                systemIsInPrl, defaultRoamingIndicator);
@@ -153,10 +169,11 @@ public class NetworkRegistrationState implements Parcelable {
     * @hide
     */
    public NetworkRegistrationState(int domain, int transportType, int regState,
            int accessNetworkTechnology, int reasonForDenial, boolean emergencyOnly,
            int[] availableServices, @Nullable CellIdentity cellIdentity, int maxDataCalls) {
        this(domain, transportType, regState, accessNetworkTechnology,
                reasonForDenial, emergencyOnly, availableServices, cellIdentity);
                                    int accessNetworkTechnology, int rejectCause,
                                    boolean emergencyOnly, int[] availableServices,
                                    @Nullable CellIdentity cellIdentity, int maxDataCalls) {
        this(domain, transportType, regState, accessNetworkTechnology, rejectCause, emergencyOnly,
                availableServices, cellIdentity);

        mDataSpecificStates = new DataSpecificRegistrationStates(maxDataCalls);
    }
@@ -166,7 +183,7 @@ public class NetworkRegistrationState implements Parcelable {
        mTransportType = source.readInt();
        mRegState = source.readInt();
        mAccessNetworkTechnology = source.readInt();
        mReasonForDenial = source.readInt();
        mRejectCause = source.readInt();
        mEmergencyOnly = source.readBoolean();
        mAvailableServices = source.createIntArray();
        mCellIdentity = source.readParcelable(CellIdentity.class.getClassLoader());
@@ -211,10 +228,10 @@ public class NetworkRegistrationState implements Parcelable {
    }

    /**
     * @return Reason for denial from network.
     * @return Network reject cause
     */
    public int getReasonForDenial() {
        return mReasonForDenial;
    public int getRejectCause() {
        return mRejectCause;
    }

    /**
@@ -265,7 +282,7 @@ public class NetworkRegistrationState implements Parcelable {
                .append(" regState=").append(regStateToString(mRegState))
                .append(" accessNetworkTechnology=")
                .append(TelephonyManager.getNetworkTypeName(mAccessNetworkTechnology))
                .append(" reasonForDenial=").append(mReasonForDenial)
                .append(" rejectCause=").append(mRejectCause)
                .append(" emergencyEnabled=").append(mEmergencyOnly)
                .append(" supportedServices=").append(mAvailableServices)
                .append(" cellIdentity=").append(mCellIdentity)
@@ -276,8 +293,8 @@ public class NetworkRegistrationState implements Parcelable {

    @Override
    public int hashCode() {
        return Objects.hash(mTransportType, mDomain, mRegState, mAccessNetworkTechnology,
                mReasonForDenial, mEmergencyOnly, mAvailableServices, mCellIdentity,
        return Objects.hash(mDomain, mTransportType, mRegState, mAccessNetworkTechnology,
                mRejectCause, mEmergencyOnly, mAvailableServices, mCellIdentity,
                mVoiceSpecificStates, mDataSpecificStates);
    }

@@ -294,7 +311,7 @@ public class NetworkRegistrationState implements Parcelable {
                && mTransportType == other.mTransportType
                && mRegState == other.mRegState
                && mAccessNetworkTechnology == other.mAccessNetworkTechnology
                && mReasonForDenial == other.mReasonForDenial
                && mRejectCause == other.mRejectCause
                && mEmergencyOnly == other.mEmergencyOnly
                && (mAvailableServices == other.mAvailableServices
                    || Arrays.equals(mAvailableServices, other.mAvailableServices))
@@ -309,7 +326,7 @@ public class NetworkRegistrationState implements Parcelable {
        dest.writeInt(mTransportType);
        dest.writeInt(mRegState);
        dest.writeInt(mAccessNetworkTechnology);
        dest.writeInt(mReasonForDenial);
        dest.writeInt(mRejectCause);
        dest.writeBoolean(mEmergencyOnly);
        dest.writeIntArray(mAvailableServices);
        dest.writeParcelable(mCellIdentity, 0);