Revert "Migrate to CompoundButton.OnCheckedChangeListener"

Revert submission 25147565-onSwitchChanged-CompoundButton

Reason for revert: breaking builds 

Bug:309601476

Reverted changes: /q/submissionid:25147565-onSwitchChanged-CompoundButton

Change-Id: Ie746db87d9c642599593aa3d5e5baf6b7ba89c0e
This commit is contained in:
Sebastian Pickl
2023-11-07 13:26:36 +00:00
committed by Android (Google) Code Review
parent 71d1f021af
commit 8979681a8d
49 changed files with 188 additions and 174 deletions

View File

@@ -150,7 +150,7 @@ public class WifiTetherSwitchBarControllerTest {
public void onSwitchChanged_switchNotEnabled_doNothingForTethering() {
when(mSwitch.isEnabled()).thenReturn(false);
mController.onCheckedChanged(mSwitch, true);
mController.onSwitchChanged(mSwitch, mSwitch.isChecked());
verify(mConnectivityManager, never()).startTethering(anyInt(), anyBoolean(), any(), any());
verify(mConnectivityManager, never()).stopTethering(anyInt());
@@ -158,7 +158,9 @@ public class WifiTetherSwitchBarControllerTest {
@Test
public void onSwitchChanged_isChecked_startTethering() {
mController.onCheckedChanged(mSwitch, true);
when(mSwitch.isChecked()).thenReturn(true);
mController.onSwitchChanged(mSwitch, mSwitch.isChecked());
verify(mConnectivityManager).startTethering(anyInt(), anyBoolean(), any(), any());
}
@@ -166,7 +168,9 @@ public class WifiTetherSwitchBarControllerTest {
@Test
public void onSwitchChanged_isNotChecked_stopTethering() {
when(mWifiManager.getWifiApState()).thenReturn(WIFI_AP_STATE_ENABLED);
mController.onCheckedChanged(mSwitch, false);
when(mSwitch.isChecked()).thenReturn(false);
mController.onSwitchChanged(mSwitch, mSwitch.isChecked());
verify(mConnectivityManager).stopTethering(anyInt());
}