OSDN Git Service

[NAN] Add transport type for NAN.
authorEtan Cohen <etancohen@google.com>
Mon, 20 Jun 2016 16:27:12 +0000 (09:27 -0700)
committerEtan Cohen <etancohen@google.com>
Mon, 20 Jun 2016 16:28:36 +0000 (09:28 -0700)
Add TRANSPORT_WIFI_NAN - specifies a peer-to-peer Wi-Fi NAN data
connectivity request.

While NAN uses Wi-Fi L1 PHY and part of the MAC - it is a different
protocol and constitutes a different transport.

Bug: 26564277
Change-Id: I975ebc72d8f97a592d18038b3d6465b7a40efa75

core/java/android/net/NetworkCapabilities.java

index e27c0fb..d6c197a 100644 (file)
@@ -405,8 +405,15 @@ public final class NetworkCapabilities implements Parcelable {
      */
     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 MAX_TRANSPORT = TRANSPORT_VPN;
+    private static final int MAX_TRANSPORT = TRANSPORT_WIFI_NAN;
 
     /**
      * Adds the given transport type to this {@code NetworkCapability} instance.
@@ -815,6 +822,7 @@ public final class NetworkCapabilities implements Parcelable {
                 case TRANSPORT_BLUETOOTH:   transports += "BLUETOOTH"; break;
                 case TRANSPORT_ETHERNET:    transports += "ETHERNET"; break;
                 case TRANSPORT_VPN:         transports += "VPN"; break;
+                case TRANSPORT_WIFI_NAN:    transports += "WIFI_NAN"; break;
             }
             if (++i < types.length) transports += "|";
         }