use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class WifiTetherMaximizeCompatibilityPreferenceControllerTest method isMaximizeCompatibilityEnabled_noConcurrencyAndGetBand5gOnly_returnTrue.
@Test
public void isMaximizeCompatibilityEnabled_noConcurrencyAndGetBand5gOnly_returnTrue() {
doReturn(false).when(mWifiManager).isBridgedApConcurrencySupported();
SoftApConfiguration config = new SoftApConfiguration.Builder().setBand(SoftApConfiguration.BAND_5GHZ).build();
doReturn(config).when(mWifiManager).getSoftApConfiguration();
assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(false);
}
use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class WifiTetherMaximizeCompatibilityPreferenceControllerTest method isMaximizeCompatibilityEnabled_concurrencySupportedAndDisabled_returnTrue.
@Test
public void isMaximizeCompatibilityEnabled_concurrencySupportedAndDisabled_returnTrue() {
SoftApConfiguration config = new SoftApConfiguration.Builder().setBridgedModeOpportunisticShutdownEnabled(false).build();
doReturn(config).when(mWifiManager).getSoftApConfiguration();
assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(true);
}
use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class WifiTetherMaximizeCompatibilityPreferenceControllerTest method isMaximizeCompatibilityEnabled_noConcurrencyAndGetBand2gAnd5g_returnTrue.
@Test
public void isMaximizeCompatibilityEnabled_noConcurrencyAndGetBand2gAnd5g_returnTrue() {
doReturn(false).when(mWifiManager).isBridgedApConcurrencySupported();
SoftApConfiguration config = new SoftApConfiguration.Builder().setBand(SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ).build();
doReturn(config).when(mWifiManager).getSoftApConfiguration();
assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(false);
}
use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class WifiTetherPasswordPreferenceControllerTest method updateDisplay_shouldUpdateValue.
@Test
public void updateDisplay_shouldUpdateValue() {
// Set controller password to anything and verify is set.
mController.displayPreference(mScreen);
mController.onPreferenceChange(mPreference, VALID_PASS);
assertThat(mController.getPasswordValidated(SoftApConfiguration.SECURITY_TYPE_WPA2_PSK)).isEqualTo(VALID_PASS);
// Create a new config using different password
final SoftApConfiguration config = new SoftApConfiguration.Builder().setPassphrase(VALID_PASS2, SoftApConfiguration.SECURITY_TYPE_WPA2_PSK).build();
when(mWifiManager.getSoftApConfiguration()).thenReturn(config);
// Call updateDisplay and verify it's changed.
mController.updateDisplay();
assertThat(mController.getPasswordValidated(SoftApConfiguration.SECURITY_TYPE_WPA2_PSK)).isEqualTo(config.getPassphrase());
assertThat(mPreference.getSummary()).isEqualTo(config.getPassphrase());
}
use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class WifiTetherSSIDPreferenceControllerTest method updateDisplay_shouldUpdateValue.
@Test
public void updateDisplay_shouldUpdateValue() {
// Set controller ssid to anything and verify is set.
mController.displayPreference(mScreen);
mController.onPreferenceChange(mPreference, "1");
assertThat(mController.getSSID()).isEqualTo("1");
// Create a new config using different SSID
final SoftApConfiguration config = new SoftApConfiguration.Builder().setSsid("test_1234").build();
when(mWifiManager.getSoftApConfiguration()).thenReturn(config);
// Call updateDisplay and verify it's changed.
mController.updateDisplay();
assertThat(mController.getSSID()).isEqualTo(config.getSsid());
assertThat(mPreference.getSummary()).isEqualTo(config.getSsid());
}
Aggregations