diff options
author | Gabriel Biren <gbiren@google.com> | 2023-06-08 18:16:23 +0000 |
---|---|---|
committer | Gabriel Biren <gbiren@google.com> | 2023-06-09 18:28:40 +0000 |
commit | 81c11a85785c7140d074b64a386c0b3a454f53f4 (patch) | |
tree | 9f206d01d7d9190cf8cde25385e8d6532a26eff6 | |
parent | 97030832d4ac17e71089b81cc056e394a3538ca1 (diff) | |
download | Wifi-81c11a85785c7140d074b64a386c0b3a454f53f4.tar.gz |
Set hasEverConnected to true for Passpoint configs
with an SSID.
SSID is only set if the Passpoint network has
connected since the last reboot.
This fixes an issue when networks are selected for
PNO scans. Without this fix, all Passpoint networks
retrieved from the PasspointManager
are non-ephemeral and have hasEverConnected = false.
This causes them to get filtered out of the PNO
SSID list.
Bug: 195659300
Test: atest PasspointManagerTest WifiConnectivityManagerTest
Test: Manual test
1. Connect to a Passpoint network.
2. Connect to a hotspot.
3. Turn off the screen.
4. Disable the hotspot.
5. Device should trigger a PNO scan and
connnect to the Passpoint network.
Change-Id: I6d17682c505003621c89f8765ecb88f860d77f88
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/PasspointManager.java | 1 | ||||
-rw-r--r-- | service/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java index 9fea31eb36..1eaac10504 100644 --- a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java +++ b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java @@ -1246,6 +1246,7 @@ public class PasspointManager { } WifiConfiguration config = provider.getWifiConfig(); config.SSID = provider.getMostRecentSsid(); + config.getNetworkSelectionStatus().setHasEverConnected(true); configs.add(config); } return configs; diff --git a/service/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java b/service/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java index ca59e17498..bb67f8320f 100644 --- a/service/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java +++ b/service/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java @@ -1379,6 +1379,7 @@ public class PasspointManagerTest extends WifiBaseTest { assertEquals(1, configs.size()); assertEquals(provider2.getConfig().getUniqueId(), configs.get(0).getPasspointUniqueId()); assertEquals(TEST_SSID, configs.get(0).SSID); + assertTrue(configs.get(0).getNetworkSelectionStatus().hasEverConnected()); } /** |