From 1c29b381b6bc74871e593eb12f3e7551e0b5d1d6 Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Wed, 14 Sep 2016 14:41:56 -0700 Subject: [PATCH] [NAN] Rename to make discovery explicit [DO NOT MERGE] Pure rename operation - no other functional changes. Bug: 31470256 Change-Id: I5110d1a673b7ba4e39350d723b5984586fec585a --- Android.mk | 2 +- ... => IWifiNanDiscoverySessionCallback.aidl} | 2 +- .../android/net/wifi/nan/IWifiNanManager.aidl | 7 +- .../android/net/wifi/nan/PublishConfig.java | 20 +-- .../android/net/wifi/nan/SubscribeConfig.java | 22 +-- ....java => WifiNanDiscoveryBaseSession.java} | 53 ++++---- ...a => WifiNanDiscoverySessionCallback.java} | 67 +++++----- .../net/wifi/nan/WifiNanEventCallback.java | 2 +- .../android/net/wifi/nan/WifiNanManager.java | 126 +++++++++--------- ...va => WifiNanPublishDiscoverySession.java} | 27 ++-- ... => WifiNanSubscribeDiscoverySession.java} | 29 ++-- 11 files changed, 185 insertions(+), 172 deletions(-) rename wifi/java/android/net/wifi/nan/{IWifiNanSessionCallback.aidl => IWifiNanDiscoverySessionCallback.aidl} (95%) rename wifi/java/android/net/wifi/nan/{WifiNanSession.java => WifiNanDiscoveryBaseSession.java} (83%) rename wifi/java/android/net/wifi/nan/{WifiNanSessionCallback.java => WifiNanDiscoverySessionCallback.java} (68%) rename wifi/java/android/net/wifi/nan/{WifiNanPublishSession.java => WifiNanPublishDiscoverySession.java} (61%) rename wifi/java/android/net/wifi/nan/{WifiNanSubscribeSession.java => WifiNanSubscribeDiscoverySession.java} (60%) diff --git a/Android.mk b/Android.mk index f1302a54e79cd..7e7388d09c9b9 100644 --- a/Android.mk +++ b/Android.mk @@ -419,7 +419,7 @@ LOCAL_SRC_FILES += \ wifi/java/android/net/wifi/IWifiManager.aidl \ wifi/java/android/net/wifi/nan/IWifiNanEventCallback.aidl \ wifi/java/android/net/wifi/nan/IWifiNanManager.aidl \ - wifi/java/android/net/wifi/nan/IWifiNanSessionCallback.aidl \ + wifi/java/android/net/wifi/nan/IWifiNanDiscoverySessionCallback.aidl \ wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \ wifi/java/android/net/wifi/IWifiScanner.aidl \ wifi/java/android/net/wifi/IRttManager.aidl \ diff --git a/wifi/java/android/net/wifi/nan/IWifiNanSessionCallback.aidl b/wifi/java/android/net/wifi/nan/IWifiNanDiscoverySessionCallback.aidl similarity index 95% rename from wifi/java/android/net/wifi/nan/IWifiNanSessionCallback.aidl rename to wifi/java/android/net/wifi/nan/IWifiNanDiscoverySessionCallback.aidl index ff2c409c1dd5e..8c1b892f6730b 100644 --- a/wifi/java/android/net/wifi/nan/IWifiNanSessionCallback.aidl +++ b/wifi/java/android/net/wifi/nan/IWifiNanDiscoverySessionCallback.aidl @@ -21,7 +21,7 @@ package android.net.wifi.nan; * * {@hide} */ -oneway interface IWifiNanSessionCallback +oneway interface IWifiNanDiscoverySessionCallback { void onSessionStarted(int sessionId); void onSessionConfigSuccess(); diff --git a/wifi/java/android/net/wifi/nan/IWifiNanManager.aidl b/wifi/java/android/net/wifi/nan/IWifiNanManager.aidl index 17ec1bc240e06..4711bad31f12e 100644 --- a/wifi/java/android/net/wifi/nan/IWifiNanManager.aidl +++ b/wifi/java/android/net/wifi/nan/IWifiNanManager.aidl @@ -19,8 +19,8 @@ package android.net.wifi.nan; import android.app.PendingIntent; import android.net.wifi.nan.ConfigRequest; +import android.net.wifi.nan.IWifiNanDiscoverySessionCallback; import android.net.wifi.nan.IWifiNanEventCallback; -import android.net.wifi.nan.IWifiNanSessionCallback; import android.net.wifi.nan.PublishConfig; import android.net.wifi.nan.SubscribeConfig; import android.net.wifi.RttManager; @@ -42,9 +42,10 @@ interface IWifiNanManager in ConfigRequest configRequest); void disconnect(int clientId, in IBinder binder); - void publish(int clientId, in PublishConfig publishConfig, in IWifiNanSessionCallback callback); + void publish(int clientId, in PublishConfig publishConfig, + in IWifiNanDiscoverySessionCallback callback); void subscribe(int clientId, in SubscribeConfig subscribeConfig, - in IWifiNanSessionCallback callback); + in IWifiNanDiscoverySessionCallback callback); // session API void updatePublish(int clientId, int sessionId, in PublishConfig publishConfig); diff --git a/wifi/java/android/net/wifi/nan/PublishConfig.java b/wifi/java/android/net/wifi/nan/PublishConfig.java index 6203f9539e7c7..f988c0b03ca52 100644 --- a/wifi/java/android/net/wifi/nan/PublishConfig.java +++ b/wifi/java/android/net/wifi/nan/PublishConfig.java @@ -32,8 +32,8 @@ import java.util.Arrays; /** * Defines the configuration of a NAN publish session. Built using * {@link PublishConfig.Builder}. A publish session is created using - * {@link WifiNanManager#publish(PublishConfig, WifiNanSessionCallback)} or updated using - * {@link WifiNanPublishSession#updatePublish(PublishConfig)}. + * {@link WifiNanManager#publish(PublishConfig, WifiNanDiscoverySessionCallback)} or updated using + * {@link WifiNanPublishDiscoverySession#updatePublish(PublishConfig)}. * * @hide PROPOSED_NAN_API */ @@ -318,12 +318,13 @@ public final class PublishConfig implements Parcelable { * Sets the number of times an unsolicited (configured using * {@link PublishConfig.Builder#setPublishType(int)}) publish session * will be broadcast. When the count is reached an event will be - * generated for {@link WifiNanSessionCallback#onSessionTerminated(int)} - * with {@link WifiNanSessionCallback#TERMINATE_REASON_DONE} [unless + * generated for {@link WifiNanDiscoverySessionCallback#onSessionTerminated(int)} + * with {@link WifiNanDiscoverySessionCallback#TERMINATE_REASON_DONE} [unless * {@link #setEnableTerminateNotification(boolean)} disables the callback]. *

* Optional. 0 by default - indicating the session doesn't terminate on its own. - * Session will be terminated when {@link WifiNanSession#terminate()} is called. + * Session will be terminated when {@link WifiNanDiscoveryBaseSession#terminate()} is + * called. * * @param publishCount Number of publish packets to broadcast. * @@ -343,12 +344,13 @@ public final class PublishConfig implements Parcelable { * {@link PublishConfig.Builder#setPublishType(int)}) publish session * will be alive - broadcasting a packet. When the TTL is reached * an event will be generated for - * {@link WifiNanSessionCallback#onSessionTerminated(int)} with - * {@link WifiNanSessionCallback#TERMINATE_REASON_DONE} [unless + * {@link WifiNanDiscoverySessionCallback#onSessionTerminated(int)} with + * {@link WifiNanDiscoverySessionCallback#TERMINATE_REASON_DONE} [unless * {@link #setEnableTerminateNotification(boolean)} disables the callback]. *

* Optional. 0 by default - indicating the session doesn't terminate on its own. - * Session will be terminated when {@link WifiNanSession#terminate()} is called. + * Session will be terminated when {@link WifiNanDiscoveryBaseSession#terminate()} is + * called. * * @param ttlSec Lifetime of a publish session in seconds. * @@ -365,7 +367,7 @@ public final class PublishConfig implements Parcelable { /** * Configure whether a publish terminate notification - * {@link WifiNanSessionCallback#onSessionTerminated(int)} is reported + * {@link WifiNanDiscoverySessionCallback#onSessionTerminated(int)} is reported * back to the callback. * * @param enable If true the terminate callback will be called when the diff --git a/wifi/java/android/net/wifi/nan/SubscribeConfig.java b/wifi/java/android/net/wifi/nan/SubscribeConfig.java index 5a2c76272f785..47f9398b642f2 100644 --- a/wifi/java/android/net/wifi/nan/SubscribeConfig.java +++ b/wifi/java/android/net/wifi/nan/SubscribeConfig.java @@ -32,8 +32,8 @@ import java.util.Arrays; /** * Defines the configuration of a NAN subscribe session. Built using * {@link SubscribeConfig.Builder}. Subscribe is done using - * {@link WifiNanManager#subscribe(SubscribeConfig, WifiNanSessionCallback)} or - * {@link WifiNanSubscribeSession#updateSubscribe(SubscribeConfig)}. + * {@link WifiNanManager#subscribe(SubscribeConfig, WifiNanDiscoverySessionCallback)} or + * {@link WifiNanSubscribeDiscoverySession#updateSubscribe(SubscribeConfig)}. * * @hide PROPOSED_NAN_API */ @@ -350,11 +350,12 @@ public final class SubscribeConfig implements Parcelable { * Sets the number of times an active ( * {@link SubscribeConfig.Builder#setSubscribeType(int)}) subscribe session * will broadcast. When the count is reached an event will be - * generated for {@link WifiNanSessionCallback#onSessionTerminated(int)} - * with {@link WifiNanSessionCallback#TERMINATE_REASON_DONE}. + * generated for {@link WifiNanDiscoverySessionCallback#onSessionTerminated(int)} + * with {@link WifiNanDiscoverySessionCallback#TERMINATE_REASON_DONE}. *

* Optional. 0 by default - indicating the session doesn't terminate on its own. - * Session will be terminated when {@link WifiNanSession#terminate()} is called. + * Session will be terminated when {@link WifiNanDiscoveryBaseSession#terminate()} is + * called. * * @param subscribeCount Number of subscribe packets to broadcast. * @@ -374,11 +375,12 @@ public final class SubscribeConfig implements Parcelable { * {@link SubscribeConfig.Builder#setSubscribeType(int)}) subscribe session * will be alive - i.e. broadcasting a packet. When the TTL is reached * an event will be generated for - * {@link WifiNanSessionCallback#onSessionTerminated(int)} with - * {@link WifiNanSessionCallback#TERMINATE_REASON_DONE}. + * {@link WifiNanDiscoverySessionCallback#onSessionTerminated(int)} with + * {@link WifiNanDiscoverySessionCallback#TERMINATE_REASON_DONE}. *

* Optional. 0 by default - indicating the session doesn't terminate on its own. - * Session will be terminated when {@link WifiNanSession#terminate()} is called. + * Session will be terminated when {@link WifiNanDiscoveryBaseSession#terminate()} is + * called. * * @param ttlSec Lifetime of a subscribe session in seconds. * @@ -397,7 +399,7 @@ public final class SubscribeConfig implements Parcelable { * Sets the match style of the subscription - how are matches from a * single match session (corresponding to the same publish action on the * peer) reported to the host (using the - * {@link WifiNanSessionCallback#onMatch(int, byte[], byte[])} + * {@link WifiNanDiscoverySessionCallback#onMatch(int, byte[], byte[])} * ). The options are: only report the first match and ignore the rest * {@link SubscribeConfig#MATCH_STYLE_FIRST_ONLY} or report every single * match {@link SubscribeConfig#MATCH_STYLE_ALL} (the default). @@ -417,7 +419,7 @@ public final class SubscribeConfig implements Parcelable { /** * Configure whether a subscribe terminate notification - * {@link WifiNanSessionCallback#onSessionTerminated(int)} is reported + * {@link WifiNanDiscoverySessionCallback#onSessionTerminated(int)} is reported * back to the callback. * * @param enable If true the terminate callback will be called when the diff --git a/wifi/java/android/net/wifi/nan/WifiNanSession.java b/wifi/java/android/net/wifi/nan/WifiNanDiscoveryBaseSession.java similarity index 83% rename from wifi/java/android/net/wifi/nan/WifiNanSession.java rename to wifi/java/android/net/wifi/nan/WifiNanDiscoveryBaseSession.java index 005ca291cbf54..58971dbdae284 100644 --- a/wifi/java/android/net/wifi/nan/WifiNanSession.java +++ b/wifi/java/android/net/wifi/nan/WifiNanDiscoveryBaseSession.java @@ -17,7 +17,6 @@ package android.net.wifi.nan; import android.annotation.Nullable; -import android.annotation.SystemApi; import android.net.wifi.RttManager; import android.util.Log; @@ -28,8 +27,8 @@ import java.lang.ref.WeakReference; /** * A class representing a single publish or subscribe NAN session. This object * will not be created directly - only its child classes are available: - * {@link WifiNanPublishSession} and {@link WifiNanSubscribeSession}. This class provides - * functionality common to both publish and subscribe discovery sessions: + * {@link WifiNanPublishDiscoverySession} and {@link WifiNanSubscribeDiscoverySession}. This + * class provides functionality common to both publish and subscribe discovery sessions: *

*

@@ -89,19 +88,21 @@ import java.util.Arrays; * device will actually disconnect from the NAN cluster once the last application disconnects. *

* Once a NAN connection is confirmed use the - * {@link #publish(PublishConfig, WifiNanSessionCallback)} or - * {@link #subscribe(SubscribeConfig, WifiNanSessionCallback)} to create publish or subscribe - * NAN discovery sessions. Events are called on the provided callback object - * {@link WifiNanSessionCallback}. Specifically, the - * {@link WifiNanSessionCallback#onPublishStarted(WifiNanPublishSession)} and - * {@link WifiNanSessionCallback#onSubscribeStarted(WifiNanSubscribeSession)} return - * {@link WifiNanPublishSession} and {@link WifiNanSubscribeSession} objects respectively on - * which additional session operations can be performed, e.g. updating the session - * {@link WifiNanPublishSession#updatePublish(PublishConfig)} and - * {@link WifiNanSubscribeSession#updateSubscribe(SubscribeConfig)}. Sessions can also be - * used to send messages using the {@link WifiNanSession#sendMessage(int, byte[], int)} APIs. - * When an application is finished with a discovery session it must terminate it using - * the {@link WifiNanSession#terminate()} API. + * {@link #publish(PublishConfig, WifiNanDiscoverySessionCallback)} or + * {@link #subscribe(SubscribeConfig, WifiNanDiscoverySessionCallback)} to create publish or + * subscribe NAN discovery sessions. Events are called on the provided callback object + * {@link WifiNanDiscoverySessionCallback}. Specifically, the + * {@link WifiNanDiscoverySessionCallback#onPublishStarted(WifiNanPublishDiscoverySession)} + * and + * {@link WifiNanDiscoverySessionCallback#onSubscribeStarted(WifiNanSubscribeDiscoverySession)} + * return {@link WifiNanPublishDiscoverySession} and {@link WifiNanSubscribeDiscoverySession} + * objects respectively on which additional session operations can be performed, e.g. updating + * the session {@link WifiNanPublishDiscoverySession#updatePublish(PublishConfig)} and + * {@link WifiNanSubscribeDiscoverySession#updateSubscribe(SubscribeConfig)}. Sessions can also + * be used to send messages using the + * {@link WifiNanDiscoveryBaseSession#sendMessage(int, byte[], int)} APIs. When an application + * is finished with a discovery session it must terminate it using the + * {@link WifiNanDiscoveryBaseSession#terminate()} API. *

* Creating connections between NAN devices is managed by the standard * {@link ConnectivityManager#requestNetwork(NetworkRequest, ConnectivityManager.NetworkCallback)}. @@ -111,7 +112,7 @@ import java.util.Arrays; * {@link android.net.NetworkCapabilities#TRANSPORT_WIFI_NAN}. *

  • {@link NetworkRequest.Builder#setNetworkSpecifier(String)} using * {@link #createNetworkSpecifier(int, byte[], byte[])} or - * {@link WifiNanSession#createNetworkSpecifier(int, int, byte[])}. + * {@link WifiNanDiscoveryBaseSession#createNetworkSpecifier(int, int, byte[])}. * * * @hide PROPOSED_NAN_API @@ -249,7 +250,7 @@ public class WifiNanManager { * Connection creation role is that of INITIATOR. Used to create a network specifier string * when requesting a NAN network. * - * @see WifiNanSession#createNetworkSpecifier(int, int, byte[]) + * @see WifiNanDiscoveryBaseSession#createNetworkSpecifier(int, int, byte[]) * @see #createNetworkSpecifier(int, byte[], byte[]) */ public static final int WIFI_NAN_DATA_PATH_ROLE_INITIATOR = 0; @@ -258,7 +259,7 @@ public class WifiNanManager { * Connection creation role is that of RESPONDER. Used to create a network specifier string * when requesting a NAN network. * - * @see WifiNanSession#createNetworkSpecifier(int, int, byte[]) + * @see WifiNanDiscoveryBaseSession#createNetworkSpecifier(int, int, byte[]) * @see #createNetworkSpecifier(int, byte[], byte[]) */ public static final int WIFI_NAN_DATA_PATH_ROLE_RESPONDER = 1; @@ -447,30 +448,30 @@ public class WifiNanManager { /** * Issue a request to the NAN service to create a new NAN publish discovery session, using * the specified {@code publishConfig} configuration. The results of the publish operation - * are routed to the callbacks of {@link WifiNanSessionCallback}: + * are routed to the callbacks of {@link WifiNanDiscoverySessionCallback}: * *

    * Other results of the publish session operations will also be routed to callbacks * on the {@code callback} object. The resulting publish session can be modified using - * {@link WifiNanPublishSession#updatePublish(PublishConfig)}. + * {@link WifiNanPublishDiscoverySession#updatePublish(PublishConfig)}. *

    - * An application must use the {@link WifiNanSession#terminate()} to terminate the publish - * discovery session once it isn't needed. This will free resources as well terminate - * any on-air transmissions. + * An application must use the {@link WifiNanDiscoveryBaseSession#terminate()} to + * terminate the publish discovery session once it isn't needed. This will free + * resources as well terminate any on-air transmissions. * * @param publishConfig The {@link PublishConfig} specifying the * configuration of the requested publish session. - * @param callback A {@link WifiNanSessionCallback} derived object to be used for session - * event callbacks. + * @param callback A {@link WifiNanDiscoverySessionCallback} derived object to be used for + * session event callbacks. */ public void publish(@NonNull PublishConfig publishConfig, - @NonNull WifiNanSessionCallback callback) { + @NonNull WifiNanDiscoverySessionCallback callback) { if (VDBG) Log.v(TAG, "publish(): config=" + publishConfig); int clientId; @@ -487,7 +488,7 @@ public class WifiNanManager { } try { mService.publish(clientId, publishConfig, - new WifiNanSessionCallbackProxy(this, looper, true, callback)); + new WifiNanDiscoverySessionCallbackProxy(this, looper, true, callback)); } catch (RemoteException e) { e.rethrowAsRuntimeException(); } @@ -516,30 +517,30 @@ public class WifiNanManager { /** * Issue a request to the NAN service to create a new NAN subscribe discovery session, using * the specified {@code subscribeConfig} configuration. The results of the subscribe - * operation are routed to the callbacks of {@link WifiNanSessionCallback}: + * operation are routed to the callbacks of {@link WifiNanDiscoverySessionCallback}: *

    *

    * Other results of the subscribe session operations will also be routed to callbacks * on the {@code callback} object. The resulting subscribe session can be modified using - * {@link WifiNanSubscribeSession#updateSubscribe(SubscribeConfig)}. + * {@link WifiNanSubscribeDiscoverySession#updateSubscribe(SubscribeConfig)}. *

    - * An application must use the {@link WifiNanSession#terminate()} to terminate the - * subscribe discovery session once it isn't needed. This will free resources as well - * terminate any on-air transmissions. + * An application must use the {@link WifiNanDiscoveryBaseSession#terminate()} to + * terminate the subscribe discovery session once it isn't needed. This will free + * resources as well terminate any on-air transmissions. * * @param subscribeConfig The {@link SubscribeConfig} specifying the * configuration of the requested subscribe session. - * @param callback A {@link WifiNanSessionCallback} derived object to be used for session - * event callbacks. + * @param callback A {@link WifiNanDiscoverySessionCallback} derived object to be used for + * session event callbacks. */ public void subscribe(@NonNull SubscribeConfig subscribeConfig, - @NonNull WifiNanSessionCallback callback) { + @NonNull WifiNanDiscoverySessionCallback callback) { if (VDBG) { Log.v(TAG, "subscribe(): config=" + subscribeConfig); } @@ -559,7 +560,7 @@ public class WifiNanManager { try { mService.subscribe(clientId, subscribeConfig, - new WifiNanSessionCallbackProxy(this, looper, false, callback)); + new WifiNanDiscoverySessionCallbackProxy(this, looper, false, callback)); } catch (RemoteException e) { e.rethrowAsRuntimeException(); } @@ -746,7 +747,7 @@ public class WifiNanManager { * This API is targeted for applications which can obtain the peer MAC address using OOB * (out-of-band) discovery. NAN discovery does not provide the MAC address of the peer - * when using NAN discovery use the alternative network specifier method - - * {@link WifiNanSession#createNetworkSpecifier(int, int, byte[])}. + * {@link WifiNanDiscoveryBaseSession#createNetworkSpecifier(int, int, byte[])}. * * @param role The role of this device: * {@link WifiNanManager#WIFI_NAN_DATA_PATH_ROLE_INITIATOR} or @@ -762,8 +763,8 @@ public class WifiNanManager { * not the same as a null token and requires the peer token to be empty as well. * * @return A string to be used to construct - * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(String)} to pass to {@link - * android.net.ConnectivityManager#requestNetwork(NetworkRequest, ConnectivityManager.NetworkCallback)} + * {@link android.net.NetworkRequest.Builder#setNetworkSpecifier(String)} to pass to + * {@link android.net.ConnectivityManager#requestNetwork(NetworkRequest, ConnectivityManager.NetworkCallback)} * [or other varieties of that API]. */ public String createNetworkSpecifier(@DataPathRole int role, @Nullable byte[] peer, @@ -1001,7 +1002,8 @@ public class WifiNanManager { } } - private static class WifiNanSessionCallbackProxy extends IWifiNanSessionCallback.Stub { + private static class WifiNanDiscoverySessionCallbackProxy extends + IWifiNanDiscoverySessionCallback.Stub { private static final int CALLBACK_SESSION_STARTED = 0; private static final int CALLBACK_SESSION_CONFIG_SUCCESS = 1; private static final int CALLBACK_SESSION_CONFIG_FAIL = 2; @@ -1016,18 +1018,20 @@ public class WifiNanManager { private final WeakReference mNanManager; private final boolean mIsPublish; - private final WifiNanSessionCallback mOriginalCallback; + private final WifiNanDiscoverySessionCallback mOriginalCallback; private final Handler mHandler; - private WifiNanSession mSession; + private WifiNanDiscoveryBaseSession mSession; - WifiNanSessionCallbackProxy(WifiNanManager mgr, Looper looper, boolean isPublish, - WifiNanSessionCallback originalCallback) { + WifiNanDiscoverySessionCallbackProxy(WifiNanManager mgr, Looper looper, boolean isPublish, + WifiNanDiscoverySessionCallback originalCallback) { mNanManager = new WeakReference<>(mgr); mIsPublish = isPublish; mOriginalCallback = originalCallback; - if (VDBG) Log.v(TAG, "WifiNanSessionCallbackProxy ctor: isPublish=" + isPublish); + if (VDBG) { + Log.v(TAG, "WifiNanDiscoverySessionCallbackProxy ctor: isPublish=" + isPublish); + } mHandler = new Handler(looper) { @Override @@ -1035,7 +1039,7 @@ public class WifiNanManager { if (DBG) Log.d(TAG, "What=" + msg.what + ", msg=" + msg); if (mNanManager.get() == null) { - Log.w(TAG, "WifiNanSessionCallbackProxy: handleMessage post GC"); + Log.w(TAG, "WifiNanDiscoverySessionCallbackProxy: handleMessage post GC"); return; } @@ -1178,11 +1182,13 @@ public class WifiNanManager { } if (mIsPublish) { - WifiNanPublishSession session = new WifiNanPublishSession(mgr, sessionId); + WifiNanPublishDiscoverySession session = new WifiNanPublishDiscoverySession(mgr, + sessionId); mSession = session; mOriginalCallback.onPublishStarted(session); } else { - WifiNanSubscribeSession session = new WifiNanSubscribeSession(mgr, sessionId); + WifiNanSubscribeDiscoverySession + session = new WifiNanSubscribeDiscoverySession(mgr, sessionId); mSession = session; mOriginalCallback.onSubscribeStarted(session); } diff --git a/wifi/java/android/net/wifi/nan/WifiNanPublishSession.java b/wifi/java/android/net/wifi/nan/WifiNanPublishDiscoverySession.java similarity index 61% rename from wifi/java/android/net/wifi/nan/WifiNanPublishSession.java rename to wifi/java/android/net/wifi/nan/WifiNanPublishDiscoverySession.java index ccd7faee8476f..cacbdbf751d8e 100644 --- a/wifi/java/android/net/wifi/nan/WifiNanPublishSession.java +++ b/wifi/java/android/net/wifi/nan/WifiNanPublishDiscoverySession.java @@ -21,32 +21,33 @@ import android.util.Log; /** * A class representing a NAN publish session. Created when - * {@link WifiNanManager#publish(PublishConfig, WifiNanSessionCallback)} is called and a + * {@link WifiNanManager#publish(PublishConfig, WifiNanDiscoverySessionCallback)} is called and a * discovery session is created and returned in - * {@link WifiNanSessionCallback#onPublishStarted(WifiNanPublishSession)}. See baseline - * functionality of all discovery sessions in {@link WifiNanSession}. This object allows updating - * an existing/running publish discovery session using {@link #updatePublish(PublishConfig)}. + * {@link WifiNanDiscoverySessionCallback#onPublishStarted(WifiNanPublishDiscoverySession)}. See + * baseline functionality of all discovery sessions in {@link WifiNanDiscoveryBaseSession}. This + * object allows updating an existing/running publish discovery session using + * {@link #updatePublish(PublishConfig)}. * * @hide PROPOSED_NAN_API */ -public class WifiNanPublishSession extends WifiNanSession { - private static final String TAG = "WifiNanPublishSession"; +public class WifiNanPublishDiscoverySession extends WifiNanDiscoveryBaseSession { + private static final String TAG = "WifiNanPublishDiscSsn"; /** @hide */ - public WifiNanPublishSession(WifiNanManager manager, int sessionId) { + public WifiNanPublishDiscoverySession(WifiNanManager manager, int sessionId) { super(manager, sessionId); } /** * Re-configure the currently active publish session. The - * {@link WifiNanSessionCallback} is not replaced - the same listener used + * {@link WifiNanDiscoverySessionCallback} is not replaced - the same listener used * at creation is still used. The results of the configuration are returned using - * {@link WifiNanSessionCallback}: + * {@link WifiNanDiscoverySessionCallback}: *

    * diff --git a/wifi/java/android/net/wifi/nan/WifiNanSubscribeSession.java b/wifi/java/android/net/wifi/nan/WifiNanSubscribeDiscoverySession.java similarity index 60% rename from wifi/java/android/net/wifi/nan/WifiNanSubscribeSession.java rename to wifi/java/android/net/wifi/nan/WifiNanSubscribeDiscoverySession.java index d0e56c521525f..58c52d5faf72a 100644 --- a/wifi/java/android/net/wifi/nan/WifiNanSubscribeSession.java +++ b/wifi/java/android/net/wifi/nan/WifiNanSubscribeDiscoverySession.java @@ -21,34 +21,35 @@ import android.util.Log; /** * A class representing a NAN subscribe session. Created when - * {@link WifiNanManager#subscribe(SubscribeConfig, WifiNanSessionCallback)} is called and a - * discovery session is created and returned in - * {@link WifiNanSessionCallback#onSubscribeStarted(WifiNanSubscribeSession)}. See baseline - * functionality of all discovery sessions in {@link WifiNanSession}. This object allows updating - * an existing/running subscribe discovery session using {@link #updateSubscribe(SubscribeConfig)}. + * {@link WifiNanManager#subscribe(SubscribeConfig, WifiNanDiscoverySessionCallback)} is called + * and a discovery session is created and returned in + * {@link WifiNanDiscoverySessionCallback#onSubscribeStarted(WifiNanSubscribeDiscoverySession)}. + * See baseline functionality of all discovery sessions in {@link WifiNanDiscoveryBaseSession}. + * This object allows updating an existing/running subscribe discovery session using + * {@link #updateSubscribe(SubscribeConfig)}. * * @hide PROPOSED_NAN_API */ -public class WifiNanSubscribeSession extends WifiNanSession { - private static final String TAG = "WifiNanSubscribeSession"; +public class WifiNanSubscribeDiscoverySession extends WifiNanDiscoveryBaseSession { + private static final String TAG = "WifiNanSubscribeDiscSsn"; /** * {@hide} */ - public WifiNanSubscribeSession(WifiNanManager manager, int sessionId) { + public WifiNanSubscribeDiscoverySession(WifiNanManager manager, int sessionId) { super(manager, sessionId); } /** * Re-configure the currently active subscribe session. The - * {@link WifiNanSessionCallback} is not replaced - the same listener used + * {@link WifiNanDiscoverySessionCallback} is not replaced - the same listener used * at creation is still used. The results of the configuration are returned using - * {@link WifiNanSessionCallback}: + * {@link WifiNanDiscoverySessionCallback}: * *