diff options
| -rw-r--r-- | api/current.txt | 32 | ||||
| -rwxr-xr-x | api/system-current.txt | 22 | ||||
| -rw-r--r-- | api/test-current.txt | 20 | ||||
| -rw-r--r-- | telephony/java/android/telephony/AccessNetworkConstants.java | 6 | ||||
| -rw-r--r-- | telephony/java/android/telephony/NetworkRegistrationInfo.java | 115 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ServiceState.java | 2 |
6 files changed, 122 insertions, 75 deletions
diff --git a/api/current.txt b/api/current.txt index a1cb0eb65dce..e011b5acbc20 100644 --- a/api/current.txt +++ b/api/current.txt @@ -44244,6 +44244,8 @@ 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 static final class AccessNetworkConstants.AccessNetworkType { @@ -44989,6 +44991,35 @@ package android.telephony { field @Deprecated public static final int UNKNOWN_RSSI = 99; // 0x63 } + public final class NetworkRegistrationInfo implements android.os.Parcelable { + method public int describeContents(); + method public int getAccessNetworkTechnology(); + method @NonNull public java.util.List<java.lang.Integer> getAvailableServices(); + method @Nullable public android.telephony.CellIdentity getCellIdentity(); + method public int getDomain(); + method public int getNrState(); + method public int getTransportType(); + method public boolean isRegistered(); + method public boolean isRoaming(); + method public boolean isSearching(); + method public void writeToParcel(android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator<android.telephony.NetworkRegistrationInfo> CREATOR; + field public static final int DOMAIN_CS = 1; // 0x1 + field public static final int DOMAIN_CS_PS = 3; // 0x3 + field public static final int DOMAIN_PS = 2; // 0x2 + field public static final int DOMAIN_UNKNOWN = 0; // 0x0 + field public static final int NR_STATE_CONNECTED = 3; // 0x3 + field public static final int NR_STATE_NONE = 0; // 0x0 + field public static final int NR_STATE_NOT_RESTRICTED = 2; // 0x2 + field public static final int NR_STATE_RESTRICTED = 1; // 0x1 + 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 class NetworkScan { method public void stopScan(); field public static final int ERROR_INTERRUPTED = 10002; // 0x2712 @@ -45161,6 +45192,7 @@ package android.telephony { method public int getChannelNumber(); method public int getDuplexMode(); method public boolean getIsManualSelection(); + method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoList(); method public String getOperatorAlphaLong(); method public String getOperatorAlphaShort(); method public String getOperatorNumeric(); diff --git a/api/system-current.txt b/api/system-current.txt index 8eac86f6b028..b206c81a1a23 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -8114,8 +8114,6 @@ package android.telephony { public final class AccessNetworkConstants { field public static final int TRANSPORT_TYPE_INVALID = -1; // 0xffffffff - field public static final int TRANSPORT_TYPE_WLAN = 2; // 0x2 - field public static final int TRANSPORT_TYPE_WWAN = 1; // 0x1 } public final class CallAttributes implements android.os.Parcelable { @@ -8743,37 +8741,18 @@ package android.telephony { } public final class NetworkRegistrationInfo implements android.os.Parcelable { - method public int describeContents(); - method public int getAccessNetworkTechnology(); - method @NonNull public java.util.List<java.lang.Integer> getAvailableServices(); - method @Nullable public android.telephony.CellIdentity getCellIdentity(); method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo(); - method public int getDomain(); - method public int getNrState(); 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<android.telephony.NetworkRegistrationInfo> CREATOR; - field public static final int DOMAIN_CS = 1; // 0x1 - field public static final int DOMAIN_CS_PS = 3; // 0x3 - field public static final int DOMAIN_PS = 2; // 0x2 - field public static final int DOMAIN_UNKNOWN = 0; // 0x0 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 { @@ -8990,7 +8969,6 @@ package android.telephony { method public int getDataNetworkType(); method public int getDataRegistrationState(); method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int); - method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoList(); method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForDomain(int); method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForTransportType(int); method public int getNrFrequencyRange(); diff --git a/api/test-current.txt b/api/test-current.txt index 2a4af615e86c..b09684f03f97 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -2888,8 +2888,6 @@ package android.telephony { public final class AccessNetworkConstants { field public static final int TRANSPORT_TYPE_INVALID = -1; // 0xffffffff - field public static final int TRANSPORT_TYPE_WLAN = 2; // 0x2 - field public static final int TRANSPORT_TYPE_WWAN = 1; // 0x1 } public final class CallQuality implements android.os.Parcelable { @@ -2952,36 +2950,18 @@ package android.telephony { } public final class NetworkRegistrationInfo implements android.os.Parcelable { - method public int describeContents(); - method public int getAccessNetworkTechnology(); - method @NonNull public java.util.List<java.lang.Integer> 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<android.telephony.NetworkRegistrationInfo> CREATOR; - field public static final int DOMAIN_CS = 1; // 0x1 - field public static final int DOMAIN_CS_PS = 3; // 0x3 - field public static final int DOMAIN_PS = 2; // 0x2 - field public static final int DOMAIN_UNKNOWN = 0; // 0x0 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 { diff --git a/telephony/java/android/telephony/AccessNetworkConstants.java b/telephony/java/android/telephony/AccessNetworkConstants.java index bb28df2b64eb..d325cd84855c 100644 --- a/telephony/java/android/telephony/AccessNetworkConstants.java +++ b/telephony/java/android/telephony/AccessNetworkConstants.java @@ -50,18 +50,12 @@ public final class AccessNetworkConstants { /** * Transport type for Wireless Wide Area Networks (i.e. Cellular) - * @hide */ - @SystemApi - @TestApi public static final int TRANSPORT_TYPE_WWAN = 1; /** * Transport type for Wireless Local Area Networks (i.e. Wifi) - * @hide */ - @SystemApi - @TestApi public static final int TRANSPORT_TYPE_WLAN = 2; /** @hide */ diff --git a/telephony/java/android/telephony/NetworkRegistrationInfo.java b/telephony/java/android/telephony/NetworkRegistrationInfo.java index cbd5ed665898..32ffb75f373c 100644 --- a/telephony/java/android/telephony/NetworkRegistrationInfo.java +++ b/telephony/java/android/telephony/NetworkRegistrationInfo.java @@ -36,10 +36,7 @@ import java.util.stream.Collectors; /** * Description of a mobile network registration info - * @hide */ -@SystemApi -@TestApi public final class NetworkRegistrationInfo implements Parcelable { /** * Network domain @@ -51,9 +48,9 @@ public final class NetworkRegistrationInfo implements Parcelable { /** Unknown / Unspecified domain */ public static final int DOMAIN_UNKNOWN = 0; - /** Circuit switching domain */ + /** Circuit switched domain */ public static final int DOMAIN_CS = android.hardware.radio.V1_5.Domain.CS; - /** Packet switching domain */ + /** Packet switched domain */ public static final int DOMAIN_PS = android.hardware.radio.V1_5.Domain.PS; /** Applicable to both CS and PS Domain */ public static final int DOMAIN_CS_PS = DOMAIN_CS | DOMAIN_PS; @@ -69,17 +66,41 @@ public final class NetworkRegistrationInfo implements Parcelable { REGISTRATION_STATE_UNKNOWN, REGISTRATION_STATE_ROAMING}) public @interface RegistrationState {} - /** Not registered. The device is not currently searching a new operator to register. */ + /** + * Not registered. The device is not currently searching a new operator to register. + * @hide + */ + @SystemApi @TestApi public static final int REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING = 0; - /** Registered on home network. */ + /** + * Registered on home network. + * @hide + */ + @SystemApi @TestApi public static final int REGISTRATION_STATE_HOME = 1; - /** Not registered. The device is currently searching a new operator to register. */ + /** + * Not registered. The device is currently searching a new operator to register. + * @hide + */ + @SystemApi @TestApi public static final int REGISTRATION_STATE_NOT_REGISTERED_SEARCHING = 2; - /** Registration denied. */ + /** + * Registration denied. + * @hide + */ + @SystemApi @TestApi public static final int REGISTRATION_STATE_DENIED = 3; - /** Registration state is unknown. */ + /** + * Registration state is unknown. + * @hide + */ + @SystemApi @TestApi public static final int REGISTRATION_STATE_UNKNOWN = 4; - /** Registered on roaming network. */ + /** + * Registered on roaming network. + * @hide + */ + @SystemApi @TestApi public static final int REGISTRATION_STATE_ROAMING = 5; /** @hide */ @@ -92,7 +113,6 @@ public final class NetworkRegistrationInfo implements Parcelable { /** * The device isn't camped on an LTE cell or the LTE cell doesn't support E-UTRA-NR * Dual Connectivity(EN-DC). - * @hide */ public static final int NR_STATE_NONE = 0; @@ -100,7 +120,6 @@ public final class NetworkRegistrationInfo implements Parcelable { * The device is camped on an LTE cell that supports E-UTRA-NR Dual Connectivity(EN-DC) but * either the use of dual connectivity with NR(DCNR) is restricted or NR is not supported by * the selected PLMN. - * @hide */ public static final int NR_STATE_RESTRICTED = 1; @@ -108,14 +127,12 @@ public final class NetworkRegistrationInfo implements Parcelable { * The device is camped on an LTE cell that supports E-UTRA-NR Dual Connectivity(EN-DC) and both * the use of dual connectivity with NR(DCNR) is not restricted and NR is supported by the * selected PLMN. - * @hide */ public static final int NR_STATE_NOT_RESTRICTED = 2; /** * The device is camped on an LTE cell that supports E-UTRA-NR Dual Connectivity(EN-DC) and * also connected to at least one 5G cell as a secondary serving cell. - * @hide */ public static final int NR_STATE_CONNECTED = 3; @@ -129,22 +146,34 @@ public final class NetworkRegistrationInfo implements Parcelable { SERVICE_TYPE_VIDEO, SERVICE_TYPE_EMERGENCY}) public @interface ServiceType {} - /** Unkown service */ + /** + * Unknown service + */ public static final int SERVICE_TYPE_UNKNOWN = 0; - /** Voice service */ + /** + * Voice service + */ public static final int SERVICE_TYPE_VOICE = 1; - /** Data service */ + /** + * Data service + */ public static final int SERVICE_TYPE_DATA = 2; - /** SMS service */ + /** + * SMS service + */ public static final int SERVICE_TYPE_SMS = 3; - /** Video service */ + /** + * Video service + */ public static final int SERVICE_TYPE_VIDEO = 4; - /** Emergency service */ + /** + * Emergency service + */ public static final int SERVICE_TYPE_EMERGENCY = 5; @Domain @@ -330,9 +359,7 @@ public final class NetworkRegistrationInfo implements Parcelable { * Get the 5G NR connection state. * * @return the 5G NR connection state. - * @hide */ - @SystemApi public @NRState int getNrState() { return mNrState; } @@ -344,7 +371,10 @@ public final class NetworkRegistrationInfo implements Parcelable { /** * @return The registration state. + * + * @hide */ + @SystemApi @TestApi public @RegistrationState int getRegistrationState() { return mRegistrationState; } @@ -352,6 +382,21 @@ public final class NetworkRegistrationInfo implements Parcelable { /** * @return {@code true} if registered on roaming network, {@code false} otherwise. */ + public boolean isRegistered() { + return mRegistrationState == REGISTRATION_STATE_HOME + || mRegistrationState == REGISTRATION_STATE_ROAMING; + } + + /** + * @return {@code true} if registered on roaming network, {@code false} otherwise. + */ + public boolean isSearching() { + return mRegistrationState == REGISTRATION_STATE_NOT_REGISTERED_SEARCHING; + } + + /** + * @return {@code true} if registered on roaming network, {@code false} otherwise. + */ public boolean isRoaming() { return mRoamingType != ServiceState.ROAMING_TYPE_NOT_ROAMING; } @@ -376,15 +421,18 @@ public final class NetworkRegistrationInfo implements Parcelable { /** * @return the current network roaming type. + * @hide */ - + @SystemApi @TestApi public @ServiceState.RoamingType int getRoamingType() { return mRoamingType; } /** * @return Whether emergency is enabled. + * @hide */ + @SystemApi @TestApi public boolean isEmergencyEnabled() { return mEmergencyOnly; } /** @@ -422,7 +470,9 @@ public final class NetworkRegistrationInfo implements Parcelable { * @return Reason for denial if the registration state is {@link #REGISTRATION_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 + * @hide */ + @SystemApi @TestApi public int getRejectCause() { return mRejectCause; } @@ -445,8 +495,10 @@ public final class NetworkRegistrationInfo implements Parcelable { /** * @return Data registration related info + * @hide */ @Nullable + @SystemApi @TestApi public DataSpecificRegistrationInfo getDataSpecificInfo() { return mDataSpecificInfo; } @@ -571,7 +623,11 @@ public final class NetworkRegistrationInfo implements Parcelable { && mNrState == other.mNrState; } + /** + * @hide + */ @Override + @SystemApi @TestApi public void writeToParcel(Parcel dest, int flags) { dest.writeInt(mDomain); dest.writeInt(mTransportType); @@ -659,7 +715,9 @@ public final class NetworkRegistrationInfo implements Parcelable { * .setRegistrationState(REGISTRATION_STATE_HOME) * .build(); * </code></pre> + * @hide */ + @SystemApi @TestApi public static final class Builder { @Domain private int mDomain; @@ -759,7 +817,9 @@ public final class NetworkRegistrationInfo implements Parcelable { * @param emergencyOnly True if this network registration is for emergency use only. * * @return The same instance of the builder. + * @hide */ + @SystemApi @TestApi public @NonNull Builder setEmergencyOnly(boolean emergencyOnly) { mEmergencyOnly = emergencyOnly; return this; @@ -771,7 +831,9 @@ public final class NetworkRegistrationInfo implements Parcelable { * @param availableServices Available services. * * @return The same instance of the builder. + * @hide */ + @SystemApi @TestApi public @NonNull Builder setAvailableServices( @NonNull @ServiceType List<Integer> availableServices) { mAvailableServices = availableServices; @@ -784,7 +846,9 @@ public final class NetworkRegistrationInfo implements Parcelable { * @param cellIdentity The cell identity. * * @return The same instance of the builder. + * @hide */ + @SystemApi @TestApi public @NonNull Builder setCellIdentity(@Nullable CellIdentity cellIdentity) { mCellIdentity = cellIdentity; return this; @@ -792,9 +856,10 @@ public final class NetworkRegistrationInfo implements Parcelable { /** * Build the NetworkRegistrationInfo. - * * @return the NetworkRegistrationInfo object. + * @hide */ + @SystemApi @TestApi public @NonNull NetworkRegistrationInfo build() { return new NetworkRegistrationInfo(mDomain, mTransportType, mRegistrationState, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices, diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index ad8ac76642ae..a26845357626 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -1836,10 +1836,8 @@ public class ServiceState implements Parcelable { * Get all of the available network registration info. * * @return List of {@link NetworkRegistrationInfo} - * @hide */ @NonNull - @SystemApi public List<NetworkRegistrationInfo> getNetworkRegistrationInfoList() { synchronized (mNetworkRegistrationInfos) { List<NetworkRegistrationInfo> newList = new ArrayList<>(); |