Merge "Moved transport to IntDef"

This commit is contained in:
Treehugger Robot
2019-03-15 23:21:29 +00:00
committed by Gerrit Code Review
7 changed files with 95 additions and 76 deletions

View File

@@ -5508,9 +5508,10 @@ package android.telecom {
package android.telephony { package android.telephony {
public static final class AccessNetworkConstants.TransportType { public final class AccessNetworkConstants {
field public static final int WLAN = 2; // 0x2 field public static final int TRANSPORT_TYPE_INVALID = -1; // 0xffffffff
field public static final int WWAN = 1; // 0x1 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 { public final class CallAttributes implements android.os.Parcelable {

View File

@@ -1617,7 +1617,7 @@ public class NetworkMonitor extends StateMachine {
// See if the data sub is registered for PS services on cell. // See if the data sub is registered for PS services on cell.
final NetworkRegistrationState nrs = dataSs.getNetworkRegistrationState( final NetworkRegistrationState nrs = dataSs.getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, NetworkRegistrationState.DOMAIN_PS,
AccessNetworkConstants.TransportType.WWAN); AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
latencyBroadcast.putExtra( latencyBroadcast.putExtra(
NetworkMonitorUtils.EXTRA_CELL_ID, NetworkMonitorUtils.EXTRA_CELL_ID,
nrs == null ? null : nrs.getCellIdentity()); nrs == null ? null : nrs.getCellIdentity());

View File

@@ -28,6 +28,7 @@ import android.content.Intent;
import android.content.res.Resources; import android.content.res.Resources;
import android.net.wifi.WifiInfo; import android.net.wifi.WifiInfo;
import android.os.UserHandle; import android.os.UserHandle;
import android.telephony.AccessNetworkConstants.TransportType;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Slog; import android.util.Slog;
@@ -92,7 +93,7 @@ public class NetworkNotificationManager {
return -1; return -1;
} }
private static String getTransportName(int transportType) { private static String getTransportName(@TransportType int transportType) {
Resources r = Resources.getSystem(); Resources r = Resources.getSystem();
String[] networkTypes = r.getStringArray(R.array.network_switch_type_name); String[] networkTypes = r.getStringArray(R.array.network_switch_type_name);
try { try {

View File

@@ -16,13 +16,59 @@
package android.telephony; package android.telephony;
import android.annotation.IntDef;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/** /**
* Contains access network related constants. * Contains access network related constants.
*/ */
public final class AccessNetworkConstants { public final class AccessNetworkConstants {
/**
* Wireless transportation type
*
* @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = {"TRANSPORT_TYPE_"},
value = {
TRANSPORT_TYPE_INVALID,
TRANSPORT_TYPE_WWAN,
TRANSPORT_TYPE_WLAN})
public @interface TransportType {}
/**
* Invalid transport type
* @hide
*/
@SystemApi
public static final int TRANSPORT_TYPE_INVALID = -1;
/**
* Transport type for Wireless Wide Area Networks (i.e. Cellular)
* @hide
*/
@SystemApi
public static final int TRANSPORT_TYPE_WWAN = 1;
/**
* Transport type for Wireless Local Area Networks (i.e. Wifi)
* @hide
*/
@SystemApi
public static final int TRANSPORT_TYPE_WLAN = 2;
/** @hide */
public static String transportTypeToString(@TransportType int transportType) {
switch (transportType) {
case TRANSPORT_TYPE_WWAN: return "WWAN";
case TRANSPORT_TYPE_WLAN: return "WLAN";
default: return Integer.toString(transportType);
}
}
public static final class AccessNetworkType { public static final class AccessNetworkType {
public static final int UNKNOWN = 0; public static final int UNKNOWN = 0;
public static final int GERAN = 1; public static final int GERAN = 1;
@@ -49,39 +95,7 @@ public final class AccessNetworkConstants {
} }
/** /**
* Wireless transportation type * Frequency bands for GERAN.
* @hide
*/
@SystemApi
public static final class TransportType {
/**
* Invalid transport type.
* @hide
*/
public static final int INVALID = -1;
/** Wireless Wide Area Networks (i.e. Cellular) */
public static final int WWAN = 1;
/** Wireless Local Area Networks (i.e. Wifi) */
public static final int WLAN = 2;
/** @hide */
private TransportType() {}
/** @hide */
public static String toString(int type) {
switch (type) {
case INVALID: return "INVALID";
case WWAN: return "WWAN";
case WLAN: return "WLAN";
default: return Integer.toString(type);
}
}
}
/**
* Frenquency bands for GERAN.
* http://www.etsi.org/deliver/etsi_ts/145000_145099/145005/14.00.00_60/ts_145005v140000p.pdf * http://www.etsi.org/deliver/etsi_ts/145000_145099/145005/14.00.00_60/ts_145005v140000p.pdf
*/ */
public static final class GeranBand { public static final class GeranBand {

View File

@@ -129,7 +129,6 @@ public class NetworkRegistrationState implements Parcelable {
@Domain @Domain
private final int mDomain; private final int mDomain;
/** {@link TransportType} */
private final int mTransportType; private final int mTransportType;
@RegState @RegState
@@ -165,14 +164,15 @@ public class NetworkRegistrationState implements Parcelable {
private DataSpecificRegistrationStates mDataSpecificStates; private DataSpecificRegistrationStates mDataSpecificStates;
/** /**
* @param domain Network domain. Must be a {@link Domain}. For {@link TransportType#WLAN} * @param domain Network domain. Must be a {@link Domain}. For transport type
* transport, this must set to {@link #DOMAIN_PS}. * {@link AccessNetworkConstants#TRANSPORT_TYPE_WLAN}, this must set to {@link #DOMAIN_PS}.
* @param transportType Transport type. Must be one of the{@link TransportType}. * @param transportType Transport type.
* @param regState Network registration state. Must be one of the {@link RegState}. For * @param regState Network registration state. Must be one of the {@link RegState}. For
* {@link TransportType#WLAN} transport, only {@link #REG_STATE_HOME} and * transport type {@link AccessNetworkConstants#TRANSPORT_TYPE_WLAN}, only
* {@link #REG_STATE_NOT_REG_NOT_SEARCHING} are valid states. * {@link #REG_STATE_HOME} and {@link #REG_STATE_NOT_REG_NOT_SEARCHING} are valid states.
* @param accessNetworkTechnology Access network technology.For {@link TransportType#WLAN} * @param accessNetworkTechnology Access network technology.For transport type
* transport, set to {@link TelephonyManager#NETWORK_TYPE_IWLAN}. * {@link AccessNetworkConstants#TRANSPORT_TYPE_WLAN}, set to
* {@link TelephonyManager#NETWORK_TYPE_IWLAN}.
* @param rejectCause Reason for denial if the registration state is {@link #REG_STATE_DENIED}. * @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 * 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 * 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
@@ -184,7 +184,8 @@ public class NetworkRegistrationState implements Parcelable {
* @param cellIdentity The identity representing a unique cell or wifi AP. Set to null if the * @param cellIdentity The identity representing a unique cell or wifi AP. Set to null if the
* information is not available. * information is not available.
*/ */
public NetworkRegistrationState(@Domain int domain, int transportType, @RegState int regState, public NetworkRegistrationState(@Domain int domain, @TransportType int transportType,
@RegState int regState,
@NetworkType int accessNetworkTechnology, int rejectCause, @NetworkType int accessNetworkTechnology, int rejectCause,
boolean emergencyOnly, boolean emergencyOnly,
@NonNull @ServiceType int[] availableServices, @NonNull @ServiceType int[] availableServices,
@@ -206,7 +207,7 @@ public class NetworkRegistrationState implements Parcelable {
* Constructor for voice network registration states. * Constructor for voice network registration states.
* @hide * @hide
*/ */
public NetworkRegistrationState(int domain, int transportType, int regState, public NetworkRegistrationState(int domain, @TransportType int transportType, int regState,
int accessNetworkTechnology, int rejectCause, boolean emergencyOnly, int accessNetworkTechnology, int rejectCause, boolean emergencyOnly,
int[] availableServices, @Nullable CellIdentity cellIdentity, boolean cssSupported, int[] availableServices, @Nullable CellIdentity cellIdentity, boolean cssSupported,
int roamingIndicator, int systemIsInPrl, int defaultRoamingIndicator) { int roamingIndicator, int systemIsInPrl, int defaultRoamingIndicator) {
@@ -221,7 +222,7 @@ public class NetworkRegistrationState implements Parcelable {
* Constructor for data network registration states. * Constructor for data network registration states.
* @hide * @hide
*/ */
public NetworkRegistrationState(int domain, int transportType, int regState, public NetworkRegistrationState(int domain, @TransportType int transportType, int regState,
int accessNetworkTechnology, int rejectCause, boolean emergencyOnly, int accessNetworkTechnology, int rejectCause, boolean emergencyOnly,
int[] availableServices, @Nullable CellIdentity cellIdentity, int maxDataCalls, int[] availableServices, @Nullable CellIdentity cellIdentity, int maxDataCalls,
boolean isDcNrRestricted, boolean isNrAvailable, boolean isEndcAvailable, boolean isDcNrRestricted, boolean isNrAvailable, boolean isEndcAvailable,
@@ -434,7 +435,8 @@ public class NetworkRegistrationState implements Parcelable {
public String toString() { public String toString() {
return new StringBuilder("NetworkRegistrationState{") return new StringBuilder("NetworkRegistrationState{")
.append(" domain=").append((mDomain == DOMAIN_CS) ? "CS" : "PS") .append(" domain=").append((mDomain == DOMAIN_CS) ? "CS" : "PS")
.append(" transportType=").append(TransportType.toString(mTransportType)) .append(" transportType=").append(
AccessNetworkConstants.transportTypeToString(mTransportType))
.append(" regState=").append(regStateToString(mRegState)) .append(" regState=").append(regStateToString(mRegState))
.append(" roamingType=").append(ServiceState.roamingTypeToString(mRoamingType)) .append(" roamingType=").append(ServiceState.roamingTypeToString(mRoamingType))
.append(" accessNetworkTechnology=") .append(" accessNetworkTechnology=")
@@ -627,7 +629,7 @@ public class NetworkRegistrationState implements Parcelable {
* *
* @return The same instance of the builder. * @return The same instance of the builder.
*/ */
public @NonNull Builder setTransportType(int transportType) { public @NonNull Builder setTransportType(@TransportType int transportType) {
mTransportType = transportType; mTransportType = transportType;
return this; return this;
} }

View File

@@ -28,6 +28,7 @@ import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.telephony.AccessNetworkConstants.AccessNetworkType; import android.telephony.AccessNetworkConstants.AccessNetworkType;
import android.telephony.AccessNetworkConstants.TransportType;
import android.telephony.NetworkRegistrationState.Domain; import android.telephony.NetworkRegistrationState.Domain;
import android.telephony.NetworkRegistrationState.NRStatus; import android.telephony.NetworkRegistrationState.NRStatus;
import android.text.TextUtils; import android.text.TextUtils;
@@ -620,7 +621,7 @@ public class ServiceState implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public @RoamingType int getVoiceRoamingType() { public @RoamingType int getVoiceRoamingType() {
final NetworkRegistrationState regState = getNetworkRegistrationState( final NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TransportType.WWAN); NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState != null) { if (regState != null) {
return regState.getRoamingType(); return regState.getRoamingType();
} }
@@ -644,7 +645,7 @@ public class ServiceState implements Parcelable {
*/ */
public boolean getDataRoamingFromRegistration() { public boolean getDataRoamingFromRegistration() {
final NetworkRegistrationState regState = getNetworkRegistrationState( final NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN); NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState != null) { if (regState != null) {
return (regState.getRegState() == NetworkRegistrationState.REG_STATE_ROAMING); return (regState.getRegState() == NetworkRegistrationState.REG_STATE_ROAMING);
} }
@@ -659,7 +660,7 @@ public class ServiceState implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public @RoamingType int getDataRoamingType() { public @RoamingType int getDataRoamingType() {
final NetworkRegistrationState regState = getNetworkRegistrationState( final NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN); NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState != null) { if (regState != null) {
return regState.getRoamingType(); return regState.getRoamingType();
} }
@@ -1130,10 +1131,10 @@ public class ServiceState implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public void setVoiceRoamingType(@RoamingType int type) { public void setVoiceRoamingType(@RoamingType int type) {
NetworkRegistrationState regState = getNetworkRegistrationState( NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TransportType.WWAN); NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState == null) { if (regState == null) {
regState = new NetworkRegistrationState( regState = new NetworkRegistrationState(
NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TransportType.WWAN, NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0,
false, null, null); false, null, null);
addNetworkRegistrationState(regState); addNetworkRegistrationState(regState);
@@ -1151,10 +1152,10 @@ public class ServiceState implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public void setDataRoamingType(@RoamingType int type) { public void setDataRoamingType(@RoamingType int type) {
NetworkRegistrationState regState = getNetworkRegistrationState( NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN); NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState == null) { if (regState == null) {
regState = new NetworkRegistrationState( regState = new NetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN, NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0,
false, null, null); false, null, null);
addNetworkRegistrationState(regState); addNetworkRegistrationState(regState);
@@ -1326,10 +1327,10 @@ public class ServiceState implements Parcelable {
// sync to network registration state // sync to network registration state
NetworkRegistrationState regState = getNetworkRegistrationState( NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TransportType.WWAN); NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState == null) { if (regState == null) {
regState = new NetworkRegistrationState( regState = new NetworkRegistrationState(
NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TransportType.WWAN, NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN, ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN,
0, false, null, null); 0, false, null, null);
addNetworkRegistrationState(regState); addNetworkRegistrationState(regState);
@@ -1353,11 +1354,11 @@ public class ServiceState implements Parcelable {
// sync to network registration state // sync to network registration state
NetworkRegistrationState regState = getNetworkRegistrationState( NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN); NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState == null) { if (regState == null) {
regState = new NetworkRegistrationState( regState = new NetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN, NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN, ServiceState.ROAMING_TYPE_NOT_ROAMING, TelephonyManager.NETWORK_TYPE_UNKNOWN,
0, false, null, null); 0, false, null, null);
addNetworkRegistrationState(regState); addNetworkRegistrationState(regState);
@@ -1391,7 +1392,7 @@ public class ServiceState implements Parcelable {
*/ */
public @NRStatus int getNrStatus() { public @NRStatus int getNrStatus() {
final NetworkRegistrationState regState = getNetworkRegistrationState( final NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN); NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState == null) return NetworkRegistrationState.NR_STATUS_NONE; if (regState == null) return NetworkRegistrationState.NR_STATUS_NONE;
return regState.getNrStatus(); return regState.getNrStatus();
} }
@@ -1576,7 +1577,7 @@ public class ServiceState implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public @TelephonyManager.NetworkType int getDataNetworkType() { public @TelephonyManager.NetworkType int getDataNetworkType() {
final NetworkRegistrationState iwlanRegState = getNetworkRegistrationState( final NetworkRegistrationState iwlanRegState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WLAN); NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WLAN);
if (iwlanRegState != null if (iwlanRegState != null
&& iwlanRegState.getRegState() == NetworkRegistrationState.REG_STATE_HOME) { && iwlanRegState.getRegState() == NetworkRegistrationState.REG_STATE_HOME) {
// If the device is on IWLAN, return IWLAN as the network type. This is to simulate the // If the device is on IWLAN, return IWLAN as the network type. This is to simulate the
@@ -1587,7 +1588,7 @@ public class ServiceState implements Parcelable {
} }
final NetworkRegistrationState regState = getNetworkRegistrationState( final NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN); NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState != null) { if (regState != null) {
return regState.getAccessNetworkTechnology(); return regState.getAccessNetworkTechnology();
} }
@@ -1598,7 +1599,7 @@ public class ServiceState implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public @TelephonyManager.NetworkType int getVoiceNetworkType() { public @TelephonyManager.NetworkType int getVoiceNetworkType() {
final NetworkRegistrationState regState = getNetworkRegistrationState( final NetworkRegistrationState regState = getNetworkRegistrationState(
NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TransportType.WWAN); NetworkRegistrationState.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regState != null) { if (regState != null) {
return regState.getAccessNetworkTechnology(); return regState.getAccessNetworkTechnology();
} }
@@ -1777,11 +1778,11 @@ public class ServiceState implements Parcelable {
/** /**
* Get the network registration states for the transport type. * Get the network registration states for the transport type.
* *
* @param transportType The {@link AccessNetworkConstants.TransportType transport type} * @param transportType The transport type
* @return List of {@link NetworkRegistrationState} * @return List of {@link NetworkRegistrationState}
* @hide * @hide
* *
* @deprecated Use {@link #getNetworkRegistrationStatesFromTransportType(int)} * @deprecated Use {@link #getNetworkRegistrationStatesForTransportType(int)}
*/ */
@NonNull @NonNull
@Deprecated @Deprecated
@@ -1793,14 +1794,14 @@ public class ServiceState implements Parcelable {
/** /**
* Get the network registration states for the transport type. * Get the network registration states for the transport type.
* *
* @param transportType The {@link AccessNetworkConstants.TransportType transport type} * @param transportType The transport type
* @return List of {@link NetworkRegistrationState} * @return List of {@link NetworkRegistrationState}
* @hide * @hide
*/ */
@NonNull @NonNull
@SystemApi @SystemApi
public List<NetworkRegistrationState> getNetworkRegistrationStatesForTransportType( public List<NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(
int transportType) { @TransportType int transportType) {
List<NetworkRegistrationState> list = new ArrayList<>(); List<NetworkRegistrationState> list = new ArrayList<>();
synchronized (mNetworkRegistrationStates) { synchronized (mNetworkRegistrationStates) {
@@ -1842,7 +1843,7 @@ public class ServiceState implements Parcelable {
* Get the network registration state for the transport type and network domain. * Get the network registration state for the transport type and network domain.
* *
* @param domain The network {@link NetworkRegistrationState.Domain domain} * @param domain The network {@link NetworkRegistrationState.Domain domain}
* @param transportType The {@link AccessNetworkConstants.TransportType transport type} * @param transportType The transport type
* @return The matching {@link NetworkRegistrationState} * @return The matching {@link NetworkRegistrationState}
* @hide * @hide
* *
@@ -1852,7 +1853,7 @@ public class ServiceState implements Parcelable {
@Deprecated @Deprecated
@SystemApi @SystemApi
public NetworkRegistrationState getNetworkRegistrationStates(@Domain int domain, public NetworkRegistrationState getNetworkRegistrationStates(@Domain int domain,
int transportType) { @TransportType int transportType) {
return getNetworkRegistrationState(domain, transportType); return getNetworkRegistrationState(domain, transportType);
} }
@@ -1860,7 +1861,7 @@ public class ServiceState implements Parcelable {
* Get the network registration state for the transport type and network domain. * Get the network registration state for the transport type and network domain.
* *
* @param domain The network {@link NetworkRegistrationState.Domain domain} * @param domain The network {@link NetworkRegistrationState.Domain domain}
* @param transportType The {@link AccessNetworkConstants.TransportType transport type} * @param transportType The transport type
* @return The matching {@link NetworkRegistrationState} * @return The matching {@link NetworkRegistrationState}
* @hide * @hide
* *
@@ -1868,7 +1869,7 @@ public class ServiceState implements Parcelable {
@Nullable @Nullable
@SystemApi @SystemApi
public NetworkRegistrationState getNetworkRegistrationState(@Domain int domain, public NetworkRegistrationState getNetworkRegistrationState(@Domain int domain,
int transportType) { @TransportType int transportType) {
synchronized (mNetworkRegistrationStates) { synchronized (mNetworkRegistrationStates) {
for (NetworkRegistrationState networkRegistrationState : mNetworkRegistrationStates) { for (NetworkRegistrationState networkRegistrationState : mNetworkRegistrationStates) {
if (networkRegistrationState.getTransportType() == transportType if (networkRegistrationState.getTransportType() == transportType

View File

@@ -107,9 +107,9 @@ public class ImsMmTelManager {
// case, since it is defined. // case, since it is defined.
put(ImsRegistrationImplBase.REGISTRATION_TECH_NONE, -1); put(ImsRegistrationImplBase.REGISTRATION_TECH_NONE, -1);
put(ImsRegistrationImplBase.REGISTRATION_TECH_LTE, put(ImsRegistrationImplBase.REGISTRATION_TECH_LTE,
AccessNetworkConstants.TransportType.WWAN); AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
put(ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN, put(ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN,
AccessNetworkConstants.TransportType.WLAN); AccessNetworkConstants.TRANSPORT_TYPE_WLAN);
}}; }};
private final RegistrationCallback mLocalCallback; private final RegistrationCallback mLocalCallback;