From 36b68df4d4d69534254d5bb35d1b424620db854b Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Tue, 4 Apr 2017 13:58:02 -0700 Subject: [PATCH] wifi: allow manual connection to a Passpoint provided network While connected to other WiFi network, a Passpoint AP with its provider installed will shown as " available via ", since the installed provider contained necessary credentials needed to connect to that AP. This CL will trigger a connection to that AP when the user taps on it for manual connection. Bug: 36357280 Test: manual connecting to a Passpoint network while connected to other network Change-Id: Idec440aa1606e80bcea56054e77ef2dc50a7ac93 --- src/com/android/settings/wifi/WifiSettings.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java index 8784d0954cc..ccb0fd349df 100644 --- a/src/com/android/settings/wifi/WifiSettings.java +++ b/src/com/android/settings/wifi/WifiSettings.java @@ -516,7 +516,10 @@ public class WifiSettings extends RestrictedSettingsFragment if (mSelectedAccessPoint.isActive()) { return super.onPreferenceTreeClick(preference); } - /** Bypass dialog and connect to unsecured or previously connected saved networks. */ + /** + * Bypass dialog and connect to unsecured networks, or previously connected saved + * networks, or Passpoint provided networks. + */ WifiConfiguration config = mSelectedAccessPoint.getConfig(); if (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) { mSelectedAccessPoint.generateOpenNetworkConfig(); @@ -525,6 +528,10 @@ public class WifiSettings extends RestrictedSettingsFragment && config.getNetworkSelectionStatus() != null && config.getNetworkSelectionStatus().getHasEverConnected()) { connect(config, true /* isSavedNetwork */); + } else if (mSelectedAccessPoint.isPasspoint()) { + // Access point provided by an installed Passpoint provider, connect using + // the associated config. + connect(config, true /* isSavedNetwork */); } else { showDialog(mSelectedAccessPoint, WifiConfigUiBase.MODE_CONNECT); }