Automatically direct the user to the captive portal in Wi-Fi Slice

Save the SSID when the user clicks the network, and then automatically
start login page when the network gets the captive portal capability.

Fixes: 128056349
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: Ia25241a8243d7d6aae604f341b512350404d9fd1
This commit is contained in:
Jason Chiu
2019-04-19 18:47:39 +08:00
parent f263f489e2
commit a73d7715d1
4 changed files with 150 additions and 17 deletions

View File

@@ -43,17 +43,21 @@ public class ConnectToWifiHandler extends Activity {
WifiDialogActivity.KEY_ACCESS_POINT_STATE);
if (network != null) {
WifiScanWorker.clearClickedWifi();
final ConnectivityManager cm = getSystemService(ConnectivityManager.class);
// start captive portal app to sign in to network
cm.startCaptivePortalApp(network);
} else if (accessPointState != null) {
connect(new AccessPoint(this, accessPointState));
}
finish();
}
@VisibleForTesting
void connect(AccessPoint accessPoint) {
WifiScanWorker.saveClickedWifi(accessPoint);
final WifiConnectListener connectListener = new WifiConnectListener(this);
switch (WifiUtils.getConnectingType(accessPoint)) {
case WifiUtils.CONNECT_TYPE_OSU_PROVISION: