- Update preference key to match the key defined in SettingsSlicesContract - Model TwoStateButtonPreference similar to TwoStatePreference (add setChecked, isChecked method) - Remove TwoStateButtonPreferenceController entirely because all methods are moved into Preference directly for better encapsulation. - Make BatterySaverButtonPrefController direclty implement TogglePreferenceController. It was not possible before because the interface between TwoStateButtonPreferene is too different from TwoStatePreference. Bug: 80106671 Test: robotests Change-Id: Ib72807dcf1b36e959e08df8d80538c3f9f79b76d
Running Settings Robolectric tests
The full suite
$ croot
$ make RunSettingsRoboTests
Running a single test class
$ croot
$ make RunSettingsRoboTests ROBOTEST_FILTER=<ClassName>
For example:
make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
You can also use partial class name in ROBOTEST_FILTER. If the partial class name matches multiple file names, all of them will be executed.