[Wi-Fi] Show Wi-Fi editor for authentication failures

When the Wi-Fi network is disabled because of authentication failures,
Wi-Fi picker should show editor before connecting or the network will
always fail to connect.

Bug: 112137755
Test: atest com.android.wifitrackerlib.StandardWifiEntryTest
Change-Id: I0ae42e7974e6bd2548e7f2595c6ae71a73398030
This commit is contained in:
Arc Wang
2020-04-27 19:37:30 +08:00
parent b33a59b860
commit 69653f0585

View File

@@ -544,15 +544,10 @@ public class WifiSettings2 extends RestrictedSettingsFragment
final WifiEntry selectedEntry =
((LongPressWifiEntryPreference) preference).getWifiEntry();
// If the clicked WiFi entry is never connected, launch Wi-Fi edit UI to edit password.
if (selectedEntry.getSecurity() != WifiEntry.SECURITY_NONE
&& selectedEntry.getSecurity() != WifiEntry.SECURITY_OWE) {
final WifiConfiguration config = selectedEntry.getWifiConfiguration();
if (config != null && !config.getNetworkSelectionStatus().hasEverConnected()) {
if (selectedEntry.shouldEditBeforeConnect()) {
launchConfigNewNetworkFragment(selectedEntry);
return true;
}
}
connect(selectedEntry, true /* editIfNoConfig */, true /* fullScreenEdit */);
} else if (preference == mAddWifiNetworkPreference) {