Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 205b585c authored by Arc Wang's avatar Arc Wang
Browse files

[Wi-Fi] Show not show Wi-Fi edit UI for never connected open Wi-Fi networks

When users click a Wi-Fi network and it's
WifiConfiguration.getNetworkSelectionStatus().hasEverConnected()
is false, WifiSettings2 will launch the Wi-Fi edit UI for users
to edit password again.
It's not necessary to show the Wi-Fi edit UI if the Wi-Fi network
is a open network.

Bug: 154548505
Test: manual
      Click a never connected secure Wi-Fi and edit UI shows.
      Click a never connected open Wi-Fi and edit UI does not show.
Change-Id: Ie8489aff001942f92fbfaafd772f84b1b4a09cf4
parent 90cce123
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -539,9 +539,11 @@ public class WifiSettings2 extends RestrictedSettingsFragment
            final WifiEntry selectedEntry =
                    ((LongPressWifiEntryPreference) preference).getWifiEntry();

            if (selectedEntry.getWifiConfiguration() != null) {
                if (!selectedEntry.getWifiConfiguration().getNetworkSelectionStatus()
                        .hasEverConnected()) {
            // 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;
                }