Loading src/com/android/settings/wifi/tether/WifiTetherMaximizeCompatibilityPreferenceController.java +4 −4 Original line number Diff line number Diff line Loading @@ -99,10 +99,10 @@ public class WifiTetherMaximizeCompatibilityPreferenceController extends } // If the BridgedAp Concurrency is not supported in early Pixel devices (e.g. Pixel 2~5), // show toggle on if the band includes SoftApConfiguration.BAND_5GHZ. // show toggle on when band is 2.4G only. final int band = config.getBand(); Log.d(TAG, "getBand:" + band); return (band & SoftApConfiguration.BAND_5GHZ) > 0; return band == SoftApConfiguration.BAND_2GHZ; } /** Loading @@ -128,8 +128,8 @@ public class WifiTetherMaximizeCompatibilityPreferenceController extends builder.setBridgedModeOpportunisticShutdownEnabled(!enabled); } else { int band = enabled ? SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ : SoftApConfiguration.BAND_2GHZ; ? SoftApConfiguration.BAND_2GHZ : SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ; Log.d(TAG, "setBand:" + band); builder.setBand(band); } Loading tests/unit/src/com/android/settings/wifi/tether/WifiTetherMaximizeCompatibilityPreferenceControllerTest.java +6 −6 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ public class WifiTetherMaximizeCompatibilityPreferenceControllerTest { .build(); doReturn(config).when(mWifiManager).getSoftApConfiguration(); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(false); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(true); } @Test Loading @@ -179,7 +179,7 @@ public class WifiTetherMaximizeCompatibilityPreferenceControllerTest { .build(); doReturn(config).when(mWifiManager).getSoftApConfiguration(); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(true); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(false); } @Test Loading @@ -190,7 +190,7 @@ public class WifiTetherMaximizeCompatibilityPreferenceControllerTest { .build(); doReturn(config).when(mWifiManager).getSoftApConfiguration(); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(true); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(false); } @Test Loading Loading @@ -223,7 +223,8 @@ public class WifiTetherMaximizeCompatibilityPreferenceControllerTest { SoftApConfiguration.Builder builder = new SoftApConfiguration.Builder(); mController.setupMaximizeCompatibility(builder); assertThat(builder.build().getBand()).isEqualTo(SoftApConfiguration.BAND_2GHZ); assertThat(builder.build().getBand()) .isEqualTo(SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ); } @Test Loading @@ -234,7 +235,6 @@ public class WifiTetherMaximizeCompatibilityPreferenceControllerTest { SoftApConfiguration.Builder builder = new SoftApConfiguration.Builder(); mController.setupMaximizeCompatibility(builder); assertThat(builder.build().getBand()) .isEqualTo(SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ); assertThat(builder.build().getBand()).isEqualTo(SoftApConfiguration.BAND_2GHZ); } } Loading
src/com/android/settings/wifi/tether/WifiTetherMaximizeCompatibilityPreferenceController.java +4 −4 Original line number Diff line number Diff line Loading @@ -99,10 +99,10 @@ public class WifiTetherMaximizeCompatibilityPreferenceController extends } // If the BridgedAp Concurrency is not supported in early Pixel devices (e.g. Pixel 2~5), // show toggle on if the band includes SoftApConfiguration.BAND_5GHZ. // show toggle on when band is 2.4G only. final int band = config.getBand(); Log.d(TAG, "getBand:" + band); return (band & SoftApConfiguration.BAND_5GHZ) > 0; return band == SoftApConfiguration.BAND_2GHZ; } /** Loading @@ -128,8 +128,8 @@ public class WifiTetherMaximizeCompatibilityPreferenceController extends builder.setBridgedModeOpportunisticShutdownEnabled(!enabled); } else { int band = enabled ? SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ : SoftApConfiguration.BAND_2GHZ; ? SoftApConfiguration.BAND_2GHZ : SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ; Log.d(TAG, "setBand:" + band); builder.setBand(band); } Loading
tests/unit/src/com/android/settings/wifi/tether/WifiTetherMaximizeCompatibilityPreferenceControllerTest.java +6 −6 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ public class WifiTetherMaximizeCompatibilityPreferenceControllerTest { .build(); doReturn(config).when(mWifiManager).getSoftApConfiguration(); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(false); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(true); } @Test Loading @@ -179,7 +179,7 @@ public class WifiTetherMaximizeCompatibilityPreferenceControllerTest { .build(); doReturn(config).when(mWifiManager).getSoftApConfiguration(); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(true); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(false); } @Test Loading @@ -190,7 +190,7 @@ public class WifiTetherMaximizeCompatibilityPreferenceControllerTest { .build(); doReturn(config).when(mWifiManager).getSoftApConfiguration(); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(true); assertThat(mController.isMaximizeCompatibilityEnabled()).isEqualTo(false); } @Test Loading Loading @@ -223,7 +223,8 @@ public class WifiTetherMaximizeCompatibilityPreferenceControllerTest { SoftApConfiguration.Builder builder = new SoftApConfiguration.Builder(); mController.setupMaximizeCompatibility(builder); assertThat(builder.build().getBand()).isEqualTo(SoftApConfiguration.BAND_2GHZ); assertThat(builder.build().getBand()) .isEqualTo(SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ); } @Test Loading @@ -234,7 +235,6 @@ public class WifiTetherMaximizeCompatibilityPreferenceControllerTest { SoftApConfiguration.Builder builder = new SoftApConfiguration.Builder(); mController.setupMaximizeCompatibility(builder); assertThat(builder.build().getBand()) .isEqualTo(SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ); assertThat(builder.build().getBand()).isEqualTo(SoftApConfiguration.BAND_2GHZ); } }