Revert^2 "Migrate to CompoundButton.OnCheckedChangeListener"

8979681a8d

Change-Id: I60edd3aabf49afbe4aa016af780baa68d928bddf
This commit is contained in:
Chaohui Wang
2023-11-07 20:41:11 +08:00
parent 8979681a8d
commit 08a1c9876e
49 changed files with 174 additions and 188 deletions

View File

@@ -292,7 +292,7 @@ public class WifiCallingSettingsForSubTest {
public void onSwitchChanged_enableSetting_shouldLaunchWfcDisclaimerFragment() {
final ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
mFragment.onSwitchChanged(null, true);
mFragment.onCheckedChanged(null, true);
// Check the WFC disclaimer fragment is launched.
verify(mFragment).startActivityForResult(intentCaptor.capture(),
@@ -337,7 +337,7 @@ public class WifiCallingSettingsForSubTest {
@Test
public void onSwitchChanged_disableSetting_shouldNotLaunchWfcDisclaimerFragment() {
mFragment.onSwitchChanged(null, false);
mFragment.onCheckedChanged(null, false);
// Check the WFC disclaimer fragment is not launched.
verify(mFragment, never()).startActivityForResult(any(Intent.class), anyInt());

View File

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