Enable launching captive portal directly

Whenever a user has connected to a captive portal network, split the
ConnectedAccessPointPreference to allow directly signing into the
captive portal or modifying the network's settings. When in any other
network state, use the old behavior of a single tappable preference that
takes the user to settings.

Bug: 63929546
Bug: 68031656
Test: make RunSettingsRoboTests
Test: manual by connecting to Captive Portal and normal WiFi networks.

Change-Id: I444202a12138d90c94bda94945c121c8c0810536
This commit is contained in:
Adam Newman
2018-03-08 16:59:34 -08:00
parent 0f382f5656
commit 7577624db7
7 changed files with 186 additions and 22 deletions

View File

@@ -511,8 +511,7 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
* Returns whether the user can sign into the network represented by this preference.
*/
private boolean canSignIntoNetwork() {
return mNetworkCapabilities != null && mNetworkCapabilities.hasCapability(
NET_CAPABILITY_CAPTIVE_PORTAL);
return WifiUtils.canSignIntoNetwork(mNetworkCapabilities);
}
/**