From c7bd5101fe7f964bbaaa74b5b6e9bb8ad876fa7c Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Tue, 9 May 2017 14:07:09 -0700 Subject: [PATCH] [AWARE] Add is out-of-band utility function Add a utility function which indicates whether the network specifier is an out-of-band network specifier. Bug: 38171946 Test: unit tests + current integration (sl4a) pass Change-Id: I68581b2c447d8547a1b35020c17188e220cca76b --- .../net/wifi/aware/WifiAwareNetworkSpecifier.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wifi/java/android/net/wifi/aware/WifiAwareNetworkSpecifier.java b/wifi/java/android/net/wifi/aware/WifiAwareNetworkSpecifier.java index e152f6ced5715..eeabbfa258927 100644 --- a/wifi/java/android/net/wifi/aware/WifiAwareNetworkSpecifier.java +++ b/wifi/java/android/net/wifi/aware/WifiAwareNetworkSpecifier.java @@ -161,6 +161,16 @@ public final class WifiAwareNetworkSpecifier extends NetworkSpecifier implements } }; + /** + * Indicates whether the network specifier specifies an OOB (out-of-band) data-path - i.e. a + * data-path created without a corresponding Aware discovery session. + * + * @hide + */ + public boolean isOutOfBand() { + return type == NETWORK_SPECIFIER_TYPE_OOB || type == NETWORK_SPECIFIER_TYPE_OOB_ANY_PEER; + } + @Override public int describeContents() { return 0;