In the Settings, the Preference#onBindViewHolder will be invoked 3 times when a preference is getting highlighted. This caused that a disabled volume slider becomes enabled after getting highlighted. This change is to optimize the init method of VolumeSeekbarPreference to speed up the initial process and fix the unexpected behavior. Bug: 275352565 Test: manual test and robotest pass Change-Id: I77f28386f6d6e4a45297f1ca7bcbaf16ed6136a4
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.