Wifi Settings: Add auto option for softap

For device with 5g support, settings will display auto, 2g, and 5g options.
For decice without 5g support, auto and 2g option are shown.

Bug: 68763822
Test: compile
Test: m RunSettingsRoboTests -j40
Test: manually test by checking UI and start hotspot with no issue
Test: manually test that wifi settings logs expected values

Change-Id: Iee9f8cff6aa48df80f5c228596cd9a14f884c274
This commit is contained in:
Ningyuan Wang
2018-01-17 16:01:49 -08:00
parent a9f6d41635
commit a8df3064cd
4 changed files with 18 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ public class WifiTetherApBandPreferenceControllerTest {
mController.displayPreference(mScreen);
assertThat(mListPreference.getEntries().length).isEqualTo(2);
assertThat(mListPreference.getEntries().length).isEqualTo(3);
}
@Test
@@ -113,13 +113,18 @@ public class WifiTetherApBandPreferenceControllerTest {
when(mWifiManager.is5GHzBandSupported()).thenReturn(true);
mController.displayPreference(mScreen);
// -1 is WifiConfiguration.AP_BAND_ANY, for 'Auto' option.
mController.onPreferenceChange(mListPreference, "-1");
assertThat(mController.getBandIndex()).isEqualTo(-1);
mController.onPreferenceChange(mListPreference, "1");
assertThat(mController.getBandIndex()).isEqualTo(1);
mController.onPreferenceChange(mListPreference, "0");
assertThat(mController.getBandIndex()).isEqualTo(0);
verify(mListener, times(2)).onTetherConfigUpdated();
verify(mListener, times(3)).onTetherConfigUpdated();
}
@Test