From af9351f884b797c40893aa03eef18114ee8a7891 Mon Sep 17 00:00:00 2001 From: Paul Jensen Date: Fri, 22 Aug 2014 09:32:07 -0400 Subject: [PATCH] Remove captive portal sign-in actions. This reverts commit e0101cd and removes the related NetworkMonitor code. The thinking is the broadcasts are not robust enough as they rely on apps working together and are not sufficiently tested. bug:17115050 Change-Id: I433032867cc4fea7191a1b13842b16825dc74df4 --- .../java/android/net/ConnectivityManager.java | 92 ------------------- 1 file changed, 92 deletions(-) diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 30be4da519..4bfef410db 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -283,98 +283,6 @@ public class ConnectivityManager { */ public static final String EXTRA_IS_CAPTIVE_PORTAL = "captivePortal"; - /** - * Broadcast Action: A connection has been established to a new network - * but a captive portal has been detected preventing internet connectivity. - * This broadcast is sent out prior to providing the user with a - * notification allowing them to sign into the network, as such it should - * only be used by apps that can automatically and silently (without user - * interaction) log into specific captive portals. It should not be used - * by apps that prompt the user to sign in, as the user has not yet - * indicated they want to proceed with signing in. - * The new network is not the default network so it can only be accessed via - * the {@link Network} extra {@link #EXTRA_NETWORK}. - * This is an ordered broadcast and so it is perfectly acceptable for - * multiple receivers to in turn consider whether they are best suited to - * address the captive portal. - * A receiver should abort the broadcast if they are sure they are the - * appropriate handler of the captive portal. If the broadcast is aborted, - * the result code must be set to one of the following: - * - */ - @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) - public static final String ACTION_CAPTIVE_PORTAL_DETECTED = - "android.net.conn.CAPTIVE_PORTAL_DETECTED"; - - /** - * Broadcast Action: A connection has been established to a new network, - * a captive portal has been detected preventing internet connectivity, - * the user was notified, and elected to sign into the captive portal. - * It may be used by apps that prompt the user to sign in. - * The new network is not the default network so it can only be accessed via - * the {@link Network} extra {@link #EXTRA_NETWORK}. - * This is an ordered broadcast and so it is perfectly acceptable for - * multiple receivers to in turn consider whether they are best suited to - * address the captive portal. - * A receiver should abort the broadcast if they are sure they are the - * appropriate handler of the captive portal. If the broadcast is aborted, - * the result code must be set to one of the following: - * - */ - @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) - public static final String ACTION_CAPTIVE_PORTAL_SIGN_IN = - "android.net.conn.CAPTIVE_PORTAL_SIGN_IN"; - - /** - * The lookup key for a {@link Network} object passed along with a - * {@link #ACTION_CAPTIVE_PORTAL_DETECTED} or - * {@link #ACTION_CAPTIVE_PORTAL_SIGN_IN} intent. This network is not the - * default network and must be accessed using this {@link Network} object. - * Retrieve with {@link android.content.Intent#getParcelableExtra(String)}. - */ - public static final String EXTRA_NETWORK = "network"; - - /** - * Specified as a result code of a {@link #ACTION_CAPTIVE_PORTAL_DETECTED} or - * {@link #ACTION_CAPTIVE_PORTAL_SIGN_IN} receiver to indicate - * the receiver has signed into the - * captive portal. After being verified to provide internet - * connectivity, this network will be made the default (assuming - * it is preferred over all other active networks). - */ - public static final int CAPTIVE_PORTAL_SIGNED_IN = 1; - - /** - * Specified as a result code of a {@link #ACTION_CAPTIVE_PORTAL_DETECTED} or - * {@link #ACTION_CAPTIVE_PORTAL_SIGN_IN} receiver to indicate - * the receiver is familiar with - * this captive portal and knows sign-in is impossible or the user - * has indicated they do not want to pursue sign-in. No other apps will - * be given the option of signing in to the network. - */ - public static final int CAPTIVE_PORTAL_DISCONNECT = 2; - /** * The absence of a connection type. * @hide