summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java11
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
index 885cf87a3..94fe673c3 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
@@ -32,7 +32,6 @@ import static android.net.wifi.WifiManager.EXTRA_SUBSCRIPTION_REMEDIATION_METHOD
import static android.net.wifi.WifiManager.EXTRA_URL;
import static com.android.server.wifi.WifiConfigurationTestUtil.SECURITY_EAP;
-import static com.android.server.wifi.WifiConfigurationTestUtil.TEST_NETWORK_ID;
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
import static org.junit.Assert.assertEquals;
@@ -174,6 +173,7 @@ public class PasspointManagerTest extends WifiBaseTest {
private static final int TEST_CREATOR_UID = 1234;
private static final int TEST_CREATOR_UID1 = 1235;
private static final int TEST_UID = 1500;
+ private static final int TEST_NETWORK_ID = 2;
@Mock Context mContext;
@Mock WifiNative mWifiNative;
@@ -921,6 +921,7 @@ public class PasspointManagerTest extends WifiBaseTest {
origWifiConfig.getKey());
verify(mWifiConfigManager).addOrUpdateNetwork(
argThat((c) -> c.FQDN.equals(TEST_FQDN)), eq(TEST_CREATOR_UID), eq(TEST_PACKAGE));
+ verify(mWifiConfigManager).allowAutojoin(TEST_NETWORK_ID, origWifiConfig.allowAutojoin);
verify(mWifiConfigManager).saveToStore(true);
verify(mWifiMetrics).incrementNumPasspointProviderInstallation();
verify(mWifiMetrics).incrementNumPasspointProviderInstallSuccess();
@@ -2123,6 +2124,7 @@ public class PasspointManagerTest extends WifiBaseTest {
origWifiConfig.getKey());
verify(mWifiConfigManager).addOrUpdateNetwork(
argThat((c) -> c.FQDN.equals(TEST_FQDN)), eq(TEST_CREATOR_UID), eq(TEST_PACKAGE));
+ verify(mWifiConfigManager).allowAutojoin(TEST_NETWORK_ID, origWifiConfig.allowAutojoin);
verify(mWifiConfigManager).saveToStore(true);
verify(mWifiMetrics).incrementNumPasspointProviderInstallation();
verify(mWifiMetrics).incrementNumPasspointProviderInstallSuccess();
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
index 19ced12fc..936a8c4c9 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
@@ -1250,6 +1250,17 @@ public class PasspointProviderTest extends WifiBaseTest {
verifyWifiConfigWithTestData(config, mProvider.getWifiConfig());
}
+ @Test
+ public void getWifiConfigWithWithAutojoinDisable() throws Exception {
+ PasspointConfiguration config = generateTestPasspointConfiguration(
+ CredentialType.USER, false);
+ mProvider = createProvider(config);
+
+ assertTrue(mProvider.getWifiConfig().allowAutojoin);
+ mProvider.setAutojoinEnabled(false);
+ assertFalse(mProvider.getWifiConfig().allowAutojoin);
+ }
+
/**
* Verify that the mac randomization setting will be included in the generated
* WifiConfiguration.