From 63fc60f512be4a5501421d5042722dd5dd4faabb Mon Sep 17 00:00:00 2001 From: Hai Shalom Date: Fri, 15 Nov 2019 13:39:00 -0800 Subject: [PATCH] [WPA3] Hide connect button for cloned networks not in range Cloned networks are WPA2 or Open networks that have a WPA3 or OWE cloned networks with the same SSID and credentials. When an AP in transition mode is in the area, the scan results will only report the higher security level. In order to prevent a case where the user forcely connects to the AP with the lower security, disable this option for those networks. Otherwise, it will look that Wi-Fi is connected, but Wi-Fi picker will not show a connected network. Bug: 143843364 Test: Manual test Change-Id: I7244c41d3bf12ba573c3cfca077d0ac2cfdcf5ed --- .../wifi/details/WifiDetailPreferenceController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java index e9d2e08bb1a..c935b6af990 100644 --- a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java +++ b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java @@ -781,6 +781,11 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController } private boolean canConnectNetwork() { + // Do not allow a cloned network to connect when out of range + // Otherwise it may create inconsistencies in the UI + if (mAccessPoint.isCloned() && mIsOutOfRange) { + return false; + } // Display connect button for disconnected AP even not in the range. return !mAccessPoint.isActive(); }