Not call MainSwitchBar.getSwitch()

This is private implement details, will be removed in future.

Should call MainSwitchBar's isChecked() and setChecked() to ensure
main switch bar's style is set correctly.

Bug: 306658427
Test: manual - on wifi tether
Test: manual - on developer options
Test: m RunSettingsRoboTests
Change-Id: I292ffbcf73da0721fc206e3dac7610a0aeb20047
This commit is contained in:
Chaohui Wang
2023-10-25 13:45:09 +08:00
parent e752f7214b
commit 12ea5afdf1
5 changed files with 22 additions and 35 deletions

View File

@@ -334,9 +334,6 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
@Override
public void onSwitchChanged(Switch switchView, boolean isChecked) {
if (switchView != mSwitchBar.getSwitch()) {
return;
}
final boolean developmentEnabledState =
DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(getContext());
if (isChecked != developmentEnabledState) {