From 93617997bb3f38d20ee73ea65f294d0a91a7b437 Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Wed, 21 Sep 2016 17:54:35 -0700 Subject: [PATCH] [NAN] Change Broadcast for NAN status change to notification only Remove information about current status of NAN. Receiver will have to query that information explicitly. New pattern (per API council review) - helps reduce window for having old information. (cherry-pick of commit 905077a590d5b63a262d6f1f4f6e555ad9b79359) Bug: 31470256 Test: unit tests & integration (sl4a) tests. Change-Id: If3d0873989389e6c69feb0d02e5d0c79cdf9679e --- .../android/net/wifi/nan/WifiNanManager.java | 36 +++---------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/wifi/java/android/net/wifi/nan/WifiNanManager.java b/wifi/java/android/net/wifi/nan/WifiNanManager.java index d66f1a3b58ffc..380924f27a13d 100644 --- a/wifi/java/android/net/wifi/nan/WifiNanManager.java +++ b/wifi/java/android/net/wifi/nan/WifiNanManager.java @@ -197,43 +197,15 @@ public class WifiNanManager { public static final String NETWORK_SPECIFIER_KEY_TOKEN = "token"; /** - * Broadcast intent action to indicate whether Wi-Fi NAN is enabled or - * disabled. An extra {@link #EXTRA_WIFI_STATE} provides the state - * information as int using {@link #WIFI_NAN_STATE_DISABLED} and - * {@link #WIFI_NAN_STATE_ENABLED} constants. This broadcast is not sticky, - * use the {@link #isAvailable()} API after registering the broadcast to check the current - * state of Wi-Fi NAN. - * - * @see #EXTRA_WIFI_STATE + * Broadcast intent action to indicate that the state of Wi-Fi NAN availability has changed. + * Use the {@link #isAvailable()} to query the current status. + * This broadcast is not sticky, use the {@link #isAvailable()} API after registering + * the broadcast to check the current state of Wi-Fi NAN. */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_WIFI_NAN_STATE_CHANGED = "android.net.wifi.nan.action.WIFI_NAN_STATE_CHANGED"; - /** - * The lookup key for an int value indicating whether Wi-Fi NAN is enabled or - * disabled. Retrieve it with - * {@link android.content.Intent#getIntExtra(String,int)}. - * - * @see #WIFI_NAN_STATE_DISABLED - * @see #WIFI_NAN_STATE_ENABLED - */ - public static final String EXTRA_WIFI_STATE = "android.net.wifi.nan.extra.WIFI_STATE"; - - /** - * Wi-Fi NAN is disabled. - * - * @see #ACTION_WIFI_NAN_STATE_CHANGED - */ - public static final int WIFI_NAN_STATE_DISABLED = 1; - - /** - * Wi-Fi NAN is enabled. - * - * @see #ACTION_WIFI_NAN_STATE_CHANGED - */ - public static final int WIFI_NAN_STATE_ENABLED = 2; - /** @hide */ @IntDef({ WIFI_NAN_DATA_PATH_ROLE_INITIATOR, WIFI_NAN_DATA_PATH_ROLE_RESPONDER})