use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class WifiTetherSecurityPreferenceControllerTest method updateDisplay_toWpa3SaeTransition_shouldUpdateSecurityValue.
@Test
public void updateDisplay_toWpa3SaeTransition_shouldUpdateSecurityValue() {
SoftApConfiguration config = new SoftApConfiguration.Builder(mConfig).setPassphrase("test_password", SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION).build();
when(mWifiManager.getSoftApConfiguration()).thenReturn(config);
mController.updateDisplay();
assertThat(mController.getSecurityType()).isEqualTo(SoftApConfiguration.SECURITY_TYPE_WPA3_SAE_TRANSITION);
assertThat(mPreference.getSummary().toString()).isEqualTo("WPA2/WPA3-Personal");
}
use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class WifiTetherSecurityPreferenceControllerTest method updateDisplay_toWpa2Psk_shouldUpdateSecurityValue.
@Test
public void updateDisplay_toWpa2Psk_shouldUpdateSecurityValue() {
SoftApConfiguration config = new SoftApConfiguration.Builder(mConfig).setPassphrase("test_password", SoftApConfiguration.SECURITY_TYPE_WPA2_PSK).build();
when(mWifiManager.getSoftApConfiguration()).thenReturn(config);
mController.updateDisplay();
assertThat(mController.getSecurityType()).isEqualTo(SoftApConfiguration.SECURITY_TYPE_WPA2_PSK);
assertThat(mPreference.getSummary().toString()).isEqualTo("WPA2-Personal");
}
use of android.net.wifi.SoftApConfiguration in project android_packages_apps_Settings by omnirom.
the class DeviceNamePreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(ApplicationProvider.getApplicationContext());
when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
mResources = spy(mContext.getResources());
when(mContext.getResources()).thenReturn(mResources);
if (Looper.myLooper() == null) {
Looper.prepare();
}
PreferenceManager preferenceManager = new PreferenceManager(mContext);
mScreen = preferenceManager.createPreferenceScreen(mContext);
mPreference = new ValidatedEditTextPreference(mContext);
mPreference.setKey(TEST_PREFERENCE_KEY);
mScreen.addPreference(mPreference);
final SoftApConfiguration configuration = new SoftApConfiguration.Builder().setSsid("test-ap").build();
when(mWifiManager.getSoftApConfiguration()).thenReturn(configuration);
mController = new DeviceNamePreferenceController(mContext, TEST_PREFERENCE_KEY);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
}
Aggregations