[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
diff --git a/src/com/android/settings/wifi/WifiSettings2.java b/src/com/android/settings/wifi/WifiSettings2.java
index 9bf5c72..3b18f5a 100644
--- a/src/com/android/settings/wifi/WifiSettings2.java
+++ b/src/com/android/settings/wifi/WifiSettings2.java
@@ -544,14 +544,9 @@
             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()) {
-                    launchConfigNewNetworkFragment(selectedEntry);
-                    return true;
-                }
+            if (selectedEntry.shouldEditBeforeConnect()) {
+                launchConfigNewNetworkFragment(selectedEntry);
+                return true;
             }
 
             connect(selectedEntry, true /* editIfNoConfig */, true /* fullScreenEdit */);