Captive portals: login activity probes like NetworkMonitor

This patch changes CaptivePortalLoginActivity captive portal test to be
consistent with NetworkMonitor by:
 - using Network.java to open the http connection.
 - adding a UserAgent property to the request header.

Test: manually tested.
Bug: 32369183
Change-Id: I33cbcdab9809c712d998da6d925bdd4e3093f8ff
This commit is contained in:
Hugo Benichi
2016-12-14 08:23:40 +09:00
parent 9e0c74f54c
commit 454e066e27

View File

@@ -229,6 +229,13 @@ public class ConnectivityManager {
*/ */
public static final String EXTRA_CAPTIVE_PORTAL_URL = "android.net.extra.CAPTIVE_PORTAL_URL"; public static final String EXTRA_CAPTIVE_PORTAL_URL = "android.net.extra.CAPTIVE_PORTAL_URL";
/**
* Key for passing a user agent string to the captive portal login activity.
* {@hide}
*/
public static final String EXTRA_CAPTIVE_PORTAL_USER_AGENT =
"android.net.extra.CAPTIVE_PORTAL_USER_AGENT";
/** /**
* Broadcast action to indicate the change of data activity status * Broadcast action to indicate the change of data activity status
* (idle or active) on a network in a recent period. * (idle or active) on a network in a recent period.