From dba103204cf09187dbb0147dac39457f5993769f Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Thu, 21 Mar 2019 16:33:15 -0700 Subject: Renamed DataSpecificRegistrationState Renamed DataSpecificRegistrationState to DataSpecificRegistrationInfo. And added some APIs to test API so they can be accessed by CTS. Test: Manual Bug: 127657991 Change-Id: I1a623c18f02cfd19ca1af9df912d859b363f42d1 --- api/system-current.txt | 6 +- api/test-current.txt | 69 +++++++++ .../android/telephony/AccessNetworkConstants.java | 3 + .../telephony/DataSpecificRegistrationInfo.java | 164 +++++++++++++++++++++ .../telephony/DataSpecificRegistrationStates.java | 146 ------------------ .../java/android/telephony/LteVopsSupportInfo.java | 2 + .../android/telephony/NetworkRegistrationInfo.java | 44 +++--- telephony/java/android/telephony/ServiceState.java | 1 + .../telephony/VoiceSpecificRegistrationInfo.java | 131 ++++++++++++++++ .../telephony/VoiceSpecificRegistrationStates.java | 114 -------------- 10 files changed, 396 insertions(+), 284 deletions(-) create mode 100644 telephony/java/android/telephony/DataSpecificRegistrationInfo.java delete mode 100644 telephony/java/android/telephony/DataSpecificRegistrationStates.java create mode 100644 telephony/java/android/telephony/VoiceSpecificRegistrationInfo.java delete mode 100644 telephony/java/android/telephony/VoiceSpecificRegistrationStates.java diff --git a/api/system-current.txt b/api/system-current.txt index dd5c9c9f90c9..2db3e83da06a 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -7558,11 +7558,11 @@ package android.telephony { field public static final int VSNCP_TIMEOUT = 2236; // 0x8bc } - public final class DataSpecificRegistrationStates implements android.os.Parcelable { + public final class DataSpecificRegistrationInfo implements android.os.Parcelable { method public int describeContents(); method @NonNull public android.telephony.LteVopsSupportInfo getLteVopsSupportInfo(); method public void writeToParcel(android.os.Parcel, int); - field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field @NonNull public static final android.os.Parcelable.Creator CREATOR; } public final class DisconnectCause { @@ -7671,7 +7671,7 @@ package android.telephony { method public int getAccessNetworkTechnology(); method @NonNull public java.util.List getAvailableServices(); method @Nullable public android.telephony.CellIdentity getCellIdentity(); - method @Nullable public android.telephony.DataSpecificRegistrationStates getDataSpecificStates(); + method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo(); method public int getDomain(); method public int getRegistrationState(); method public int getRejectCause(); diff --git a/api/test-current.txt b/api/test-current.txt index 417a9edf3720..d309bcd68199 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -2552,10 +2552,34 @@ package android.telecom { package android.telephony { + public final class AccessNetworkConstants { + field public static final int TRANSPORT_TYPE_WLAN = 2; // 0x2 + field public static final int TRANSPORT_TYPE_WWAN = 1; // 0x1 + } + public class CarrierConfigManager { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void overrideConfig(int, @Nullable android.os.PersistableBundle); } + public final class DataSpecificRegistrationInfo implements android.os.Parcelable { + method public int describeContents(); + method @NonNull public android.telephony.LteVopsSupportInfo getLteVopsSupportInfo(); + method public void writeToParcel(android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + public final class LteVopsSupportInfo implements android.os.Parcelable { + ctor public LteVopsSupportInfo(int, int); + method public int describeContents(); + method public int getEmcBearerSupport(); + method public int getVopsSupport(); + method public void writeToParcel(android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int LTE_STATUS_NOT_AVAILABLE = 1; // 0x1 + field public static final int LTE_STATUS_NOT_SUPPORTED = 3; // 0x3 + field public static final int LTE_STATUS_SUPPORTED = 2; // 0x2 + } + public class MbmsDownloadSession implements java.lang.AutoCloseable { field public static final String MBMS_DOWNLOAD_SERVICE_OVERRIDE_METADATA = "mbms-download-service-override"; } @@ -2568,7 +2592,52 @@ package android.telephony { field public static final String MBMS_STREAMING_SERVICE_OVERRIDE_METADATA = "mbms-streaming-service-override"; } + public final class NetworkRegistrationInfo implements android.os.Parcelable { + method public int describeContents(); + method public int getAccessNetworkTechnology(); + method @NonNull public java.util.List getAvailableServices(); + method @Nullable public android.telephony.CellIdentity getCellIdentity(); + method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo(); + method public int getDomain(); + method public int getRegistrationState(); + method public int getRejectCause(); + method public int getRoamingType(); + method public int getTransportType(); + method public boolean isEmergencyEnabled(); + method public boolean isRoaming(); + method public void writeToParcel(android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int DOMAIN_CS = 1; // 0x1 + field public static final int DOMAIN_PS = 2; // 0x2 + field public static final int REGISTRATION_STATE_DENIED = 3; // 0x3 + field public static final int REGISTRATION_STATE_HOME = 1; // 0x1 + field public static final int REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING = 0; // 0x0 + field public static final int REGISTRATION_STATE_NOT_REGISTERED_SEARCHING = 2; // 0x2 + field public static final int REGISTRATION_STATE_ROAMING = 5; // 0x5 + field public static final int REGISTRATION_STATE_UNKNOWN = 4; // 0x4 + field public static final int SERVICE_TYPE_DATA = 2; // 0x2 + field public static final int SERVICE_TYPE_EMERGENCY = 5; // 0x5 + field public static final int SERVICE_TYPE_SMS = 3; // 0x3 + field public static final int SERVICE_TYPE_UNKNOWN = 0; // 0x0 + field public static final int SERVICE_TYPE_VIDEO = 4; // 0x4 + field public static final int SERVICE_TYPE_VOICE = 1; // 0x1 + } + + public static final class NetworkRegistrationInfo.Builder { + ctor public NetworkRegistrationInfo.Builder(); + method @NonNull public android.telephony.NetworkRegistrationInfo build(); + method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setAccessNetworkTechnology(int); + method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setAvailableServices(@NonNull java.util.List); + method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setCellIdentity(@Nullable android.telephony.CellIdentity); + method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setDomain(int); + method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setEmergencyOnly(boolean); + method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRegistrationState(int); + method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRejectCause(int); + method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setTransportType(int); + } + public class ServiceState implements android.os.Parcelable { + method public void addNetworkRegistrationInfo(android.telephony.NetworkRegistrationInfo); method public void setCdmaSystemAndNetworkId(int, int); method public void setCellBandwidths(int[]); method public void setChannelNumber(int); diff --git a/telephony/java/android/telephony/AccessNetworkConstants.java b/telephony/java/android/telephony/AccessNetworkConstants.java index 81553a3bc0f8..afa35b4d4de3 100644 --- a/telephony/java/android/telephony/AccessNetworkConstants.java +++ b/telephony/java/android/telephony/AccessNetworkConstants.java @@ -18,6 +18,7 @@ package android.telephony; import android.annotation.IntDef; import android.annotation.SystemApi; +import android.annotation.TestApi; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -51,6 +52,7 @@ public final class AccessNetworkConstants { * @hide */ @SystemApi + @TestApi public static final int TRANSPORT_TYPE_WWAN = 1; /** @@ -58,6 +60,7 @@ public final class AccessNetworkConstants { * @hide */ @SystemApi + @TestApi public static final int TRANSPORT_TYPE_WLAN = 2; /** @hide */ diff --git a/telephony/java/android/telephony/DataSpecificRegistrationInfo.java b/telephony/java/android/telephony/DataSpecificRegistrationInfo.java new file mode 100644 index 000000000000..fbf488e590fd --- /dev/null +++ b/telephony/java/android/telephony/DataSpecificRegistrationInfo.java @@ -0,0 +1,164 @@ +/* + * Copyright 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.telephony; + +import android.annotation.NonNull; +import android.annotation.SystemApi; +import android.annotation.TestApi; +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.Objects; + + +/** + * Class that stores information specific to data network registration. + * @hide + */ +@SystemApi +@TestApi +public final class DataSpecificRegistrationInfo implements Parcelable { + /** + * @hide + * The maximum number of simultaneous Data Calls that + * must be established using setupDataCall(). + */ + public final int maxDataCalls; + + /** + * @hide + * Indicates if the use of dual connectivity with NR is restricted. + * Reference: 3GPP TS 24.301 v15.03 section 9.3.3.12A. + */ + public final boolean isDcNrRestricted; + + /** + * Indicates if NR is supported by the selected PLMN. + * @hide + * {@code true} if the bit N is in the PLMN-InfoList-r15 is true and the selected PLMN is + * present in plmn-IdentityList at position N. + * Reference: 3GPP TS 36.331 v15.2.2 section 6.3.1 PLMN-InfoList-r15. + * 3GPP TS 36.331 v15.2.2 section 6.2.2 SystemInformationBlockType1 message. + */ + public final boolean isNrAvailable; + + /** + * @hide + * Indicates that if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the primary serving + * cell. + * + * True the primary serving cell is LTE cell and the plmn-InfoList-r15 is present in SIB2 and + * at least one bit in this list is true, otherwise this value should be false. + * + * Reference: 3GPP TS 36.331 v15.2.2 6.3.1 System information blocks. + */ + public final boolean isEnDcAvailable; + + /** + * Provides network support info for LTE VoPS and LTE Emergency bearer support + */ + private final LteVopsSupportInfo mLteVopsSupportInfo; + + /** + * @hide + */ + DataSpecificRegistrationInfo( + int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable, + boolean isEnDcAvailable, LteVopsSupportInfo lteVops) { + this.maxDataCalls = maxDataCalls; + this.isDcNrRestricted = isDcNrRestricted; + this.isNrAvailable = isNrAvailable; + this.isEnDcAvailable = isEnDcAvailable; + this.mLteVopsSupportInfo = lteVops; + } + + private DataSpecificRegistrationInfo(Parcel source) { + maxDataCalls = source.readInt(); + isDcNrRestricted = source.readBoolean(); + isNrAvailable = source.readBoolean(); + isEnDcAvailable = source.readBoolean(); + mLteVopsSupportInfo = LteVopsSupportInfo.CREATOR.createFromParcel(source); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(maxDataCalls); + dest.writeBoolean(isDcNrRestricted); + dest.writeBoolean(isNrAvailable); + dest.writeBoolean(isEnDcAvailable); + mLteVopsSupportInfo.writeToParcel(dest, flags); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public String toString() { + return new StringBuilder().append(this.getClass().getName()) + .append(" :{") + .append(" maxDataCalls = " + maxDataCalls) + .append(" isDcNrRestricted = " + isDcNrRestricted) + .append(" isNrAvailable = " + isNrAvailable) + .append(" isEnDcAvailable = " + isEnDcAvailable) + .append(mLteVopsSupportInfo.toString()) + .append(" }") + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable, + mLteVopsSupportInfo); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + + if (!(o instanceof DataSpecificRegistrationInfo)) return false; + + DataSpecificRegistrationInfo other = (DataSpecificRegistrationInfo) o; + return this.maxDataCalls == other.maxDataCalls + && this.isDcNrRestricted == other.isDcNrRestricted + && this.isNrAvailable == other.isNrAvailable + && this.isEnDcAvailable == other.isEnDcAvailable + && this.mLteVopsSupportInfo.equals(other.mLteVopsSupportInfo); + } + + public static final @NonNull Parcelable.Creator CREATOR = + new Parcelable.Creator() { + @Override + public DataSpecificRegistrationInfo createFromParcel(Parcel source) { + return new DataSpecificRegistrationInfo(source); + } + + @Override + public DataSpecificRegistrationInfo[] newArray(int size) { + return new DataSpecificRegistrationInfo[size]; + } + }; + + /** + * @return The LTE VOPS (Voice over Packet Switched) support information + */ + @NonNull + public LteVopsSupportInfo getLteVopsSupportInfo() { + return mLteVopsSupportInfo; + } +} diff --git a/telephony/java/android/telephony/DataSpecificRegistrationStates.java b/telephony/java/android/telephony/DataSpecificRegistrationStates.java deleted file mode 100644 index 8eb345ac258a..000000000000 --- a/telephony/java/android/telephony/DataSpecificRegistrationStates.java +++ /dev/null @@ -1,146 +0,0 @@ -package android.telephony; - -import android.annotation.NonNull; -import android.annotation.SystemApi; -import android.os.Parcel; -import android.os.Parcelable; - -import java.util.Objects; - - -/** - * Class that stores information specific to data network registration. - * @hide - */ -@SystemApi -public final class DataSpecificRegistrationStates implements Parcelable{ - /** - * @hide - * The maximum number of simultaneous Data Calls that - * must be established using setupDataCall(). - */ - public final int maxDataCalls; - - /** - * @hide - * Indicates if the use of dual connectivity with NR is restricted. - * Reference: 3GPP TS 24.301 v15.03 section 9.3.3.12A. - */ - public final boolean isDcNrRestricted; - - /** - * Indicates if NR is supported by the selected PLMN. - * @hide - * {@code true} if the bit N is in the PLMN-InfoList-r15 is true and the selected PLMN is - * present in plmn-IdentityList at position N. - * Reference: 3GPP TS 36.331 v15.2.2 section 6.3.1 PLMN-InfoList-r15. - * 3GPP TS 36.331 v15.2.2 section 6.2.2 SystemInformationBlockType1 message. - */ - public final boolean isNrAvailable; - - /** - * @hide - * Indicates that if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the primary serving - * cell. - * - * True the primary serving cell is LTE cell and the plmn-InfoList-r15 is present in SIB2 and - * at least one bit in this list is true, otherwise this value should be false. - * - * Reference: 3GPP TS 36.331 v15.2.2 6.3.1 System information blocks. - */ - public final boolean isEnDcAvailable; - - /** - * Provides network support info for LTE VoPS and LTE Emergency bearer support - */ - private final LteVopsSupportInfo lteVopsSupportInfo; - - /** - * @hide - */ - DataSpecificRegistrationStates( - int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable, - boolean isEnDcAvailable, LteVopsSupportInfo lteVops) { - this.maxDataCalls = maxDataCalls; - this.isDcNrRestricted = isDcNrRestricted; - this.isNrAvailable = isNrAvailable; - this.isEnDcAvailable = isEnDcAvailable; - this.lteVopsSupportInfo = lteVops; - } - - private DataSpecificRegistrationStates(Parcel source) { - maxDataCalls = source.readInt(); - isDcNrRestricted = source.readBoolean(); - isNrAvailable = source.readBoolean(); - isEnDcAvailable = source.readBoolean(); - lteVopsSupportInfo = LteVopsSupportInfo.CREATOR.createFromParcel(source); - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - dest.writeInt(maxDataCalls); - dest.writeBoolean(isDcNrRestricted); - dest.writeBoolean(isNrAvailable); - dest.writeBoolean(isEnDcAvailable); - lteVopsSupportInfo.writeToParcel(dest, flags); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public String toString() { - return new StringBuilder().append(this.getClass().getName()) - .append(" :{") - .append(" maxDataCalls = " + maxDataCalls) - .append(" isDcNrRestricted = " + isDcNrRestricted) - .append(" isNrAvailable = " + isNrAvailable) - .append(" isEnDcAvailable = " + isEnDcAvailable) - .append(lteVopsSupportInfo.toString()) - .append(" }") - .toString(); - } - - @Override - public int hashCode() { - return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable, - lteVopsSupportInfo); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - - if (!(o instanceof DataSpecificRegistrationStates)) return false; - - DataSpecificRegistrationStates other = (DataSpecificRegistrationStates) o; - return this.maxDataCalls == other.maxDataCalls - && this.isDcNrRestricted == other.isDcNrRestricted - && this.isNrAvailable == other.isNrAvailable - && this.isEnDcAvailable == other.isEnDcAvailable - && this.lteVopsSupportInfo.equals(other.lteVopsSupportInfo); - } - - public static final @android.annotation.NonNull Parcelable.Creator CREATOR = - new Parcelable.Creator() { - @Override - public DataSpecificRegistrationStates createFromParcel(Parcel source) { - return new DataSpecificRegistrationStates(source); - } - - @Override - public DataSpecificRegistrationStates[] newArray(int size) { - return new DataSpecificRegistrationStates[size]; - } - }; - - /** - * @return LteVopsSupportInfo - */ - @NonNull - public LteVopsSupportInfo getLteVopsSupportInfo() { - return lteVopsSupportInfo; - } -} diff --git a/telephony/java/android/telephony/LteVopsSupportInfo.java b/telephony/java/android/telephony/LteVopsSupportInfo.java index ee45f0761e0b..ec9f078367b8 100644 --- a/telephony/java/android/telephony/LteVopsSupportInfo.java +++ b/telephony/java/android/telephony/LteVopsSupportInfo.java @@ -18,6 +18,7 @@ package android.telephony; import android.annotation.IntDef; import android.annotation.SystemApi; +import android.annotation.TestApi; import android.os.Parcel; import android.os.Parcelable; @@ -30,6 +31,7 @@ import java.util.Objects; * @hide */ @SystemApi +@TestApi public final class LteVopsSupportInfo implements Parcelable { /**@hide*/ diff --git a/telephony/java/android/telephony/NetworkRegistrationInfo.java b/telephony/java/android/telephony/NetworkRegistrationInfo.java index 9145b2532817..1dc29979dc61 100644 --- a/telephony/java/android/telephony/NetworkRegistrationInfo.java +++ b/telephony/java/android/telephony/NetworkRegistrationInfo.java @@ -20,6 +20,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; +import android.annotation.TestApi; import android.os.Parcel; import android.os.Parcelable; import android.telephony.AccessNetworkConstants.TransportType; @@ -38,6 +39,7 @@ import java.util.stream.Collectors; * @hide */ @SystemApi +@TestApi public final class NetworkRegistrationInfo implements Parcelable { /** * Network domain @@ -174,10 +176,10 @@ public final class NetworkRegistrationInfo implements Parcelable { private CellIdentity mCellIdentity; @Nullable - private VoiceSpecificRegistrationStates mVoiceSpecificStates; + private VoiceSpecificRegistrationInfo mVoiceSpecificInfo; @Nullable - private DataSpecificRegistrationStates mDataSpecificStates; + private DataSpecificRegistrationInfo mDataSpecificInfo; /** * @param domain Network domain. Must be a {@link Domain}. For transport type @@ -234,7 +236,7 @@ public final class NetworkRegistrationInfo implements Parcelable { this(domain, transportType, registrationState, accessNetworkTechnology, rejectCause, emergencyOnly, availableServices, cellIdentity); - mVoiceSpecificStates = new VoiceSpecificRegistrationStates(cssSupported, roamingIndicator, + mVoiceSpecificInfo = new VoiceSpecificRegistrationInfo(cssSupported, roamingIndicator, systemIsInPrl, defaultRoamingIndicator); } @@ -253,9 +255,9 @@ public final class NetworkRegistrationInfo implements Parcelable { this(domain, transportType, registrationState, accessNetworkTechnology, rejectCause, emergencyOnly, availableServices, cellIdentity); - mDataSpecificStates = new DataSpecificRegistrationStates( + mDataSpecificInfo = new DataSpecificRegistrationInfo( maxDataCalls, isDcNrRestricted, isNrAvailable, isEndcAvailable, lteVopsSupportInfo); - updateNrState(mDataSpecificStates); + updateNrState(mDataSpecificInfo); } private NetworkRegistrationInfo(Parcel source) { @@ -269,10 +271,10 @@ public final class NetworkRegistrationInfo implements Parcelable { mAvailableServices = new ArrayList<>(); source.readList(mAvailableServices, Integer.class.getClassLoader()); mCellIdentity = source.readParcelable(CellIdentity.class.getClassLoader()); - mVoiceSpecificStates = source.readParcelable( - VoiceSpecificRegistrationStates.class.getClassLoader()); - mDataSpecificStates = source.readParcelable( - DataSpecificRegistrationStates.class.getClassLoader()); + mVoiceSpecificInfo = source.readParcelable( + VoiceSpecificRegistrationInfo.class.getClassLoader()); + mDataSpecificInfo = source.readParcelable( + DataSpecificRegistrationInfo.class.getClassLoader()); mNrState = source.readInt(); } @@ -389,16 +391,16 @@ public final class NetworkRegistrationInfo implements Parcelable { * @hide */ @Nullable - public VoiceSpecificRegistrationStates getVoiceSpecificStates() { - return mVoiceSpecificStates; + public VoiceSpecificRegistrationInfo getVoiceSpecificInfo() { + return mVoiceSpecificInfo; } /** * @return Data registration related info */ @Nullable - public DataSpecificRegistrationStates getDataSpecificStates() { - return mDataSpecificStates; + public DataSpecificRegistrationInfo getDataSpecificInfo() { + return mDataSpecificInfo; } @Override @@ -474,8 +476,8 @@ public final class NetworkRegistrationInfo implements Parcelable { ? mAvailableServices.stream().map(type -> serviceTypeToString(type)) .collect(Collectors.joining(",")) : null) + "]") .append(" cellIdentity=").append(mCellIdentity) - .append(" voiceSpecificStates=").append(mVoiceSpecificStates) - .append(" dataSpecificStates=").append(mDataSpecificStates) + .append(" voiceSpecificInfo=").append(mVoiceSpecificInfo) + .append(" dataSpecificInfo=").append(mDataSpecificInfo) .append(" nrState=").append(nrStateToString(mNrState)) .append("}").toString(); } @@ -484,7 +486,7 @@ public final class NetworkRegistrationInfo implements Parcelable { public int hashCode() { return Objects.hash(mDomain, mTransportType, mRegistrationState, mRoamingType, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices, - mCellIdentity, mVoiceSpecificStates, mDataSpecificStates, mNrState); + mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState); } @Override @@ -505,8 +507,8 @@ public final class NetworkRegistrationInfo implements Parcelable { && mEmergencyOnly == other.mEmergencyOnly && mAvailableServices.equals(other.mAvailableServices) && Objects.equals(mCellIdentity, other.mCellIdentity) - && Objects.equals(mVoiceSpecificStates, other.mVoiceSpecificStates) - && Objects.equals(mDataSpecificStates, other.mDataSpecificStates) + && Objects.equals(mVoiceSpecificInfo, other.mVoiceSpecificInfo) + && Objects.equals(mDataSpecificInfo, other.mDataSpecificInfo) && mNrState == other.mNrState; } @@ -521,8 +523,8 @@ public final class NetworkRegistrationInfo implements Parcelable { dest.writeBoolean(mEmergencyOnly); dest.writeList(mAvailableServices); dest.writeParcelable(mCellIdentity, 0); - dest.writeParcelable(mVoiceSpecificStates, 0); - dest.writeParcelable(mDataSpecificStates, 0); + dest.writeParcelable(mVoiceSpecificInfo, 0); + dest.writeParcelable(mDataSpecificInfo, 0); dest.writeInt(mNrState); } @@ -543,7 +545,7 @@ public final class NetworkRegistrationInfo implements Parcelable { * * @param state data specific registration state contains the 5G NR indicators. */ - private void updateNrState(DataSpecificRegistrationStates state) { + private void updateNrState(DataSpecificRegistrationInfo state) { mNrState = NR_STATE_NONE; if (state.isEnDcAvailable) { if (!state.isDcNrRestricted && state.isNrAvailable) { diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index df31f50d28a4..49398ed881b9 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -1855,6 +1855,7 @@ public class ServiceState implements Parcelable { /** * @hide */ + @TestApi public void addNetworkRegistrationInfo(NetworkRegistrationInfo regState) { if (regState == null) return; diff --git a/telephony/java/android/telephony/VoiceSpecificRegistrationInfo.java b/telephony/java/android/telephony/VoiceSpecificRegistrationInfo.java new file mode 100644 index 000000000000..18a533a46273 --- /dev/null +++ b/telephony/java/android/telephony/VoiceSpecificRegistrationInfo.java @@ -0,0 +1,131 @@ +/* + * Copyright 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.telephony; + +import android.annotation.NonNull; +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.Objects; + + +/** + * Class that stores information specific to voice network registration. + * @hide + */ +public class VoiceSpecificRegistrationInfo implements Parcelable{ + /** + * oncurrent services support indicator. if + * registered on a CDMA system. + * false - Concurrent services not supported, + * true - Concurrent services supported + */ + public final boolean cssSupported; + + /** + * TSB-58 Roaming Indicator if registered + * on a CDMA or EVDO system or -1 if not. + * Valid values are 0-255. + */ + public final int roamingIndicator; + + /** + * indicates whether the current system is in the + * PRL if registered on a CDMA or EVDO system or -1 if + * not. 0=not in the PRL, 1=in the PRL + */ + public final int systemIsInPrl; + + /** + * default Roaming Indicator from the PRL, + * if registered on a CDMA or EVDO system or -1 if not. + * Valid values are 0-255. + */ + public final int defaultRoamingIndicator; + + VoiceSpecificRegistrationInfo(boolean cssSupported, int roamingIndicator, int systemIsInPrl, + int defaultRoamingIndicator) { + this.cssSupported = cssSupported; + this.roamingIndicator = roamingIndicator; + this.systemIsInPrl = systemIsInPrl; + this.defaultRoamingIndicator = defaultRoamingIndicator; + } + + private VoiceSpecificRegistrationInfo(Parcel source) { + this.cssSupported = source.readBoolean(); + this.roamingIndicator = source.readInt(); + this.systemIsInPrl = source.readInt(); + this.defaultRoamingIndicator = source.readInt(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeBoolean(cssSupported); + dest.writeInt(roamingIndicator); + dest.writeInt(systemIsInPrl); + dest.writeInt(defaultRoamingIndicator); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public String toString() { + return "VoiceSpecificRegistrationInfo {" + + " mCssSupported=" + cssSupported + + " mRoamingIndicator=" + roamingIndicator + + " mSystemIsInPrl=" + systemIsInPrl + + " mDefaultRoamingIndicator=" + defaultRoamingIndicator + "}"; + } + + @Override + public int hashCode() { + return Objects.hash(cssSupported, roamingIndicator, systemIsInPrl, + defaultRoamingIndicator); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + + if (o == null || !(o instanceof VoiceSpecificRegistrationInfo)) { + return false; + } + + VoiceSpecificRegistrationInfo other = (VoiceSpecificRegistrationInfo) o; + return this.cssSupported == other.cssSupported + && this.roamingIndicator == other.roamingIndicator + && this.systemIsInPrl == other.systemIsInPrl + && this.defaultRoamingIndicator == other.defaultRoamingIndicator; + } + + + public static final @NonNull Parcelable.Creator CREATOR = + new Parcelable.Creator() { + @Override + public VoiceSpecificRegistrationInfo createFromParcel(Parcel source) { + return new VoiceSpecificRegistrationInfo(source); + } + + @Override + public VoiceSpecificRegistrationInfo[] newArray(int size) { + return new VoiceSpecificRegistrationInfo[size]; + } + }; +} diff --git a/telephony/java/android/telephony/VoiceSpecificRegistrationStates.java b/telephony/java/android/telephony/VoiceSpecificRegistrationStates.java deleted file mode 100644 index d8ce5b43e4d6..000000000000 --- a/telephony/java/android/telephony/VoiceSpecificRegistrationStates.java +++ /dev/null @@ -1,114 +0,0 @@ -package android.telephony; - -import android.os.Parcel; -import android.os.Parcelable; - -import java.util.Objects; - - -/** - * Class that stores information specific to voice network registration. - * @hide - */ -public class VoiceSpecificRegistrationStates implements Parcelable{ - /** - * oncurrent services support indicator. if - * registered on a CDMA system. - * false - Concurrent services not supported, - * true - Concurrent services supported - */ - public final boolean cssSupported; - - /** - * TSB-58 Roaming Indicator if registered - * on a CDMA or EVDO system or -1 if not. - * Valid values are 0-255. - */ - public final int roamingIndicator; - - /** - * indicates whether the current system is in the - * PRL if registered on a CDMA or EVDO system or -1 if - * not. 0=not in the PRL, 1=in the PRL - */ - public final int systemIsInPrl; - - /** - * default Roaming Indicator from the PRL, - * if registered on a CDMA or EVDO system or -1 if not. - * Valid values are 0-255. - */ - public final int defaultRoamingIndicator; - - VoiceSpecificRegistrationStates(boolean cssSupported, int roamingIndicator, int systemIsInPrl, - int defaultRoamingIndicator) { - this.cssSupported = cssSupported; - this.roamingIndicator = roamingIndicator; - this.systemIsInPrl = systemIsInPrl; - this.defaultRoamingIndicator = defaultRoamingIndicator; - } - - private VoiceSpecificRegistrationStates(Parcel source) { - this.cssSupported = source.readBoolean(); - this.roamingIndicator = source.readInt(); - this.systemIsInPrl = source.readInt(); - this.defaultRoamingIndicator = source.readInt(); - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - dest.writeBoolean(cssSupported); - dest.writeInt(roamingIndicator); - dest.writeInt(systemIsInPrl); - dest.writeInt(defaultRoamingIndicator); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public String toString() { - return "VoiceSpecificRegistrationStates {" - + " mCssSupported=" + cssSupported - + " mRoamingIndicator=" + roamingIndicator - + " mSystemIsInPrl=" + systemIsInPrl - + " mDefaultRoamingIndicator=" + defaultRoamingIndicator + "}"; - } - - @Override - public int hashCode() { - return Objects.hash(cssSupported, roamingIndicator, systemIsInPrl, - defaultRoamingIndicator); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - - if (o == null || !(o instanceof VoiceSpecificRegistrationStates)) { - return false; - } - - VoiceSpecificRegistrationStates other = (VoiceSpecificRegistrationStates) o; - return this.cssSupported == other.cssSupported - && this.roamingIndicator == other.roamingIndicator - && this.systemIsInPrl == other.systemIsInPrl - && this.defaultRoamingIndicator == other.defaultRoamingIndicator; - } - - - public static final @android.annotation.NonNull Parcelable.Creator CREATOR = - new Parcelable.Creator() { - @Override - public VoiceSpecificRegistrationStates createFromParcel(Parcel source) { - return new VoiceSpecificRegistrationStates(source); - } - - @Override - public VoiceSpecificRegistrationStates[] newArray(int size) { - return new VoiceSpecificRegistrationStates[size]; - } - }; -} \ No newline at end of file -- cgit v1.2.3-59-g8ed1b