use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class DeviceNamePreferenceController method setTetherSsidName.
private void setTetherSsidName(String deviceName) {
final SoftApConfiguration config = mWifiManager.getSoftApConfiguration();
// TODO: If tether is running, turn off the AP and restart it after setting config.
mWifiManager.setSoftApConfiguration(new SoftApConfiguration.Builder(config).setSsid(deviceName).build());
}
use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class HotspotConditionControllerTest method setupSoftApConfiguration.
private void setupSoftApConfiguration() {
final SoftApConfiguration wifiApConfig = new SoftApConfiguration.Builder().setSsid(WIFI_AP_SSID).build();
mContext.getSystemService(WifiManager.class).setSoftApConfiguration(wifiApConfig);
}
use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class WifiTetherPasswordPreferenceControllerTest method updateDisplay_shouldSetInputType.
@Test
public void updateDisplay_shouldSetInputType() {
// 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(mPreference.isPassword()).isTrue();
}
use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class WifiTetherSSIDPreferenceControllerTest method displayPreference_wifiApDisabled_shouldHideQrCodeIcon.
@Test
public void displayPreference_wifiApDisabled_shouldHideQrCodeIcon() {
when(mWifiManager.isWifiApEnabled()).thenReturn(false);
final SoftApConfiguration config = new SoftApConfiguration.Builder().setSsid("test_1234").setPassphrase("test_password", SoftApConfiguration.SECURITY_TYPE_WPA2_PSK).build();
when(mWifiManager.getSoftApConfiguration()).thenReturn(config);
mController.displayPreference(mScreen);
assertThat(mController.isQrCodeButtonAvailable()).isEqualTo(false);
}
use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class WifiTetherMaximizeCompatibilityPreferenceControllerTest method isMaximizeCompatibilityEnabled_noConcurrencyAndGetBand2gOnly_returnFalse.
@Test
public void isMaximizeCompatibilityEnabled_noConcurrencyAndGetBand2gOnly_returnFalse() {
doReturn(false).when(mWifiManager).isBridgedApConcurrencySupported();
SoftApConfiguration config = new SoftApConfiguration.Builder().setBand(SoftApConfiguration.BAND_2GHZ).build();
doReturn(config).when(mWifiManager).getSoftApConfiguration();
assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(true);
}
Aggregations