Wifi: Replace dual_band with 5GHz band support

As part of the support of the 6GHz band, the concept of dual-band is no
longer valid since we have more than 2 bands supported by Android and
can be checked on the device.

This commit replaces checks on dual-band support with an explicit check
on 5GHz band support.

Bug: 145936758
Bug: 139354972
Test: Manual
Change-Id: Ia118dedb573f61a148764146edf8091ae253a3e2
This commit is contained in:
Ahmed ElArabawy
2019-12-09 14:48:07 -08:00
parent d8c711d891
commit ead637e0c8
2 changed files with 8 additions and 8 deletions

View File

@@ -129,7 +129,7 @@ public class WifiTetherApBandPreferenceController extends WifiTetherBasePreferen
private boolean is5GhzBandSupported() { private boolean is5GhzBandSupported() {
final String countryCode = mWifiManager.getCountryCode(); final String countryCode = mWifiManager.getCountryCode();
if (!mWifiManager.isDualBandSupported() || countryCode == null) { if (!mWifiManager.is5GHzBandSupported() || countryCode == null) {
return false; return false;
} }
return true; return true;

View File

@@ -82,7 +82,7 @@ public class WifiTetherApBandPreferenceControllerTest {
@Test @Test
public void display_5GhzSupported_shouldDisplayFullList() { public void display_5GhzSupported_shouldDisplayFullList() {
when(mWifiManager.getCountryCode()).thenReturn("US"); when(mWifiManager.getCountryCode()).thenReturn("US");
when(mWifiManager.isDualBandSupported()).thenReturn(true); when(mWifiManager.is5GHzBandSupported()).thenReturn(true);
when(mWifiManager.isDualModeSupported()).thenReturn(true); when(mWifiManager.isDualModeSupported()).thenReturn(true);
mController.displayPreference(mScreen); mController.displayPreference(mScreen);
@@ -94,7 +94,7 @@ public class WifiTetherApBandPreferenceControllerTest {
@Test @Test
public void display_noCountryCode_shouldDisable() { public void display_noCountryCode_shouldDisable() {
when(mWifiManager.getCountryCode()).thenReturn(null); when(mWifiManager.getCountryCode()).thenReturn(null);
when(mWifiManager.isDualBandSupported()).thenReturn(true); when(mWifiManager.is5GHzBandSupported()).thenReturn(true);
mController.displayPreference(mScreen); mController.displayPreference(mScreen);
@@ -106,7 +106,7 @@ public class WifiTetherApBandPreferenceControllerTest {
@Test @Test
public void display_5GhzNotSupported_shouldDisable() { public void display_5GhzNotSupported_shouldDisable() {
when(mWifiManager.getCountryCode()).thenReturn("US"); when(mWifiManager.getCountryCode()).thenReturn("US");
when(mWifiManager.isDualBandSupported()).thenReturn(false); when(mWifiManager.is5GHzBandSupported()).thenReturn(false);
mController.displayPreference(mScreen); mController.displayPreference(mScreen);
@@ -118,7 +118,7 @@ public class WifiTetherApBandPreferenceControllerTest {
@Test @Test
public void changePreference_noDualModeWith5G_shouldUpdateValue() { public void changePreference_noDualModeWith5G_shouldUpdateValue() {
when(mWifiManager.getCountryCode()).thenReturn("US"); when(mWifiManager.getCountryCode()).thenReturn("US");
when(mWifiManager.isDualBandSupported()).thenReturn(true); when(mWifiManager.is5GHzBandSupported()).thenReturn(true);
mController.displayPreference(mScreen); mController.displayPreference(mScreen);
@@ -145,7 +145,7 @@ public class WifiTetherApBandPreferenceControllerTest {
@Test @Test
public void changePreference_dualModeWith5G_shouldUpdateValue() { public void changePreference_dualModeWith5G_shouldUpdateValue() {
when(mWifiManager.getCountryCode()).thenReturn("US"); when(mWifiManager.getCountryCode()).thenReturn("US");
when(mWifiManager.isDualBandSupported()).thenReturn(true); when(mWifiManager.is5GHzBandSupported()).thenReturn(true);
when(mWifiManager.isDualModeSupported()).thenReturn(true); when(mWifiManager.isDualModeSupported()).thenReturn(true);
mController.displayPreference(mScreen); mController.displayPreference(mScreen);
@@ -172,7 +172,7 @@ public class WifiTetherApBandPreferenceControllerTest {
@Test @Test
public void updateDisplay_shouldUpdateValue() { public void updateDisplay_shouldUpdateValue() {
when(mWifiManager.getCountryCode()).thenReturn("US"); when(mWifiManager.getCountryCode()).thenReturn("US");
when(mWifiManager.isDualBandSupported()).thenReturn(true); when(mWifiManager.is5GHzBandSupported()).thenReturn(true);
// Set controller band index to 1 and verify is set. // Set controller band index to 1 and verify is set.
mController.displayPreference(mScreen); mController.displayPreference(mScreen);
@@ -180,7 +180,7 @@ public class WifiTetherApBandPreferenceControllerTest {
assertThat(mController.getBandIndex()).isEqualTo(1); assertThat(mController.getBandIndex()).isEqualTo(1);
// Disable 5Ghz band // Disable 5Ghz band
when(mWifiManager.isDualBandSupported()).thenReturn(false); when(mWifiManager.is5GHzBandSupported()).thenReturn(false);
// Call updateDisplay and verify it's changed. // Call updateDisplay and verify it's changed.
mController.updateDisplay(); mController.updateDisplay();