[Wi-Fi HotSpot] Improve Wi-Fi hotspot settings entries visibility problem
When the security type of hotspot changed, the hidden item will showed because of the Expanded child list is set as constant. To improve it, dynamicall adjust the Expanded child count according to the security type. Bug: 138594907 Test: Manually 1. Enter Settings APP -> Network & internet -> Hotspot & tethering ->Wi-Fi hotspot 2. Check if there are only two expanded items if the Security type is None, or three expaned items if the Security type is WPA2-personal 3. Change the Security type and back to check item 2 match or not. Change-Id: I84d1c5dca94d6a218cfc7ecd57e201e1cffdd878
This commit is contained in:
@@ -128,19 +128,19 @@ public class WifiTetherApBandPreferenceControllerTest {
|
||||
mController.onPreferenceChange(mPreference, "-1");
|
||||
assertThat(mController.getBandIndex()).isEqualTo(1);
|
||||
assertThat(mPreference.getSummary()).isEqualTo(FIVE_GHZ_STRING);
|
||||
verify(mListener, times(1)).onTetherConfigUpdated();
|
||||
verify(mListener, times(1)).onTetherConfigUpdated(mController);
|
||||
|
||||
// set to 5 Ghz
|
||||
mController.onPreferenceChange(mPreference, "1");
|
||||
assertThat(mController.getBandIndex()).isEqualTo(1);
|
||||
assertThat(mPreference.getSummary()).isEqualTo(FIVE_GHZ_STRING);
|
||||
verify(mListener, times(2)).onTetherConfigUpdated();
|
||||
verify(mListener, times(2)).onTetherConfigUpdated(mController);
|
||||
|
||||
// set to 2 Ghz
|
||||
mController.onPreferenceChange(mPreference, "0");
|
||||
assertThat(mController.getBandIndex()).isEqualTo(0);
|
||||
assertThat(mPreference.getSummary()).isEqualTo(TWO_GHZ_STRING);
|
||||
verify(mListener, times(3)).onTetherConfigUpdated();
|
||||
verify(mListener, times(3)).onTetherConfigUpdated(mController);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -155,19 +155,19 @@ public class WifiTetherApBandPreferenceControllerTest {
|
||||
mController.onPreferenceChange(mPreference, "-1");
|
||||
assertThat(mController.getBandIndex()).isEqualTo(-1);
|
||||
assertThat(mPreference.getSummary()).isEqualTo(ALL_BANDS);
|
||||
verify(mListener, times(1)).onTetherConfigUpdated();
|
||||
verify(mListener, times(1)).onTetherConfigUpdated(mController);
|
||||
|
||||
// should revert to the default for 5 Ghz only since this is not supported with this config
|
||||
mController.onPreferenceChange(mPreference, "1");
|
||||
assertThat(mController.getBandIndex()).isEqualTo(-1);
|
||||
assertThat(mPreference.getSummary()).isEqualTo(ALL_BANDS);
|
||||
verify(mListener, times(2)).onTetherConfigUpdated();
|
||||
verify(mListener, times(2)).onTetherConfigUpdated(mController);
|
||||
|
||||
// set to 2 Ghz
|
||||
mController.onPreferenceChange(mPreference, "0");
|
||||
assertThat(mController.getBandIndex()).isEqualTo(0);
|
||||
assertThat(mPreference.getSummary()).isEqualTo(TWO_GHZ_STRING);
|
||||
verify(mListener, times(3)).onTetherConfigUpdated();
|
||||
verify(mListener, times(3)).onTetherConfigUpdated(mController);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -99,7 +99,7 @@ public class WifiTetherPasswordPreferenceControllerTest {
|
||||
assertThat(mController.getPasswordValidated(WifiConfiguration.KeyMgmt.WPA2_PSK))
|
||||
.isEqualTo(VALID_PASS2);
|
||||
|
||||
verify(mListener, times(2)).onTetherConfigUpdated();
|
||||
verify(mListener, times(2)).onTetherConfigUpdated(mController);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -102,7 +102,7 @@ public class WifiTetherSSIDPreferenceControllerTest {
|
||||
mController.onPreferenceChange(mPreference, "0");
|
||||
assertThat(mController.getSSID()).isEqualTo("0");
|
||||
|
||||
verify(mListener, times(2)).onTetherConfigUpdated();
|
||||
verify(mListener, times(2)).onTetherConfigUpdated(mController);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user