[NAN] Add transport type for NAN.

am: 305ea28a43

Change-Id: I9e12a30de06481418fa2c322fbeef0ecde75f746
This commit is contained in:
Etan Cohen
2016-09-16 18:45:49 +00:00
committed by android-build-merger

View File

@@ -405,8 +405,15 @@ public final class NetworkCapabilities implements Parcelable {
*/ */
public static final int TRANSPORT_VPN = 4; public static final int TRANSPORT_VPN = 4;
/**
* Indicates this network uses a Wi-Fi NAN transport.
*
* @hide PROPOSED_NAN_API
*/
public static final int TRANSPORT_WIFI_NAN = 5;
private static final int MIN_TRANSPORT = TRANSPORT_CELLULAR; private static final int MIN_TRANSPORT = TRANSPORT_CELLULAR;
private static final int MAX_TRANSPORT = TRANSPORT_VPN; private static final int MAX_TRANSPORT = TRANSPORT_WIFI_NAN;
/** /**
* Adds the given transport type to this {@code NetworkCapability} instance. * Adds the given transport type to this {@code NetworkCapability} instance.
@@ -862,6 +869,7 @@ public final class NetworkCapabilities implements Parcelable {
case TRANSPORT_BLUETOOTH: transports += "BLUETOOTH"; break; case TRANSPORT_BLUETOOTH: transports += "BLUETOOTH"; break;
case TRANSPORT_ETHERNET: transports += "ETHERNET"; break; case TRANSPORT_ETHERNET: transports += "ETHERNET"; break;
case TRANSPORT_VPN: transports += "VPN"; break; case TRANSPORT_VPN: transports += "VPN"; break;
case TRANSPORT_WIFI_NAN: transports += "WIFI_NAN"; break;
} }
if (++i < types.length) transports += "|"; if (++i < types.length) transports += "|";
} }