Merge "Add Test Network and Transport types" am: 9a5d3ba1ad

am: 9dd06ba6a9

Change-Id: I371a4f3bdbbfd001e9694e29843b6b7119b938b0
This commit is contained in:
Benedict Wong
2019-02-14 10:59:02 -08:00
committed by android-build-merger
2 changed files with 24 additions and 5 deletions

View File

@@ -678,11 +678,20 @@ public class ConnectivityManager {
@Deprecated @Deprecated
public static final int TYPE_VPN = 17; public static final int TYPE_VPN = 17;
/** {@hide} */ /**
public static final int MAX_RADIO_TYPE = TYPE_VPN; * A network that is exclusively meant to be used for testing
*
* @deprecated Use {@link NetworkCapabilities} instead.
* @hide
*/
@Deprecated
public static final int TYPE_TEST = 18; // TODO: Remove this once NetworkTypes are unused.
/** {@hide} */ /** {@hide} */
public static final int MAX_NETWORK_TYPE = TYPE_VPN; public static final int MAX_RADIO_TYPE = TYPE_TEST;
/** {@hide} */
public static final int MAX_NETWORK_TYPE = TYPE_TEST;
private static final int MIN_NETWORK_TYPE = TYPE_MOBILE; private static final int MIN_NETWORK_TYPE = TYPE_MOBILE;

View File

@@ -597,6 +597,7 @@ public final class NetworkCapabilities implements Parcelable {
TRANSPORT_VPN, TRANSPORT_VPN,
TRANSPORT_WIFI_AWARE, TRANSPORT_WIFI_AWARE,
TRANSPORT_LOWPAN, TRANSPORT_LOWPAN,
TRANSPORT_TEST,
}) })
public @interface Transport { } public @interface Transport { }
@@ -635,10 +636,18 @@ public final class NetworkCapabilities implements Parcelable {
*/ */
public static final int TRANSPORT_LOWPAN = 6; public static final int TRANSPORT_LOWPAN = 6;
/**
* Indicates this network uses a Test-only virtual interface as a transport.
*
* @hide
*/
@TestApi
public static final int TRANSPORT_TEST = 7;
/** @hide */ /** @hide */
public static final int MIN_TRANSPORT = TRANSPORT_CELLULAR; public static final int MIN_TRANSPORT = TRANSPORT_CELLULAR;
/** @hide */ /** @hide */
public static final int MAX_TRANSPORT = TRANSPORT_LOWPAN; public static final int MAX_TRANSPORT = TRANSPORT_TEST;
/** @hide */ /** @hide */
public static boolean isValidTransport(@Transport int transportType) { public static boolean isValidTransport(@Transport int transportType) {
@@ -652,7 +661,8 @@ public final class NetworkCapabilities implements Parcelable {
"ETHERNET", "ETHERNET",
"VPN", "VPN",
"WIFI_AWARE", "WIFI_AWARE",
"LOWPAN" "LOWPAN",
"TEST"
}; };
/** /**