Preferences shouldn't be initialized at onAttach() because the settings style hasn't been loaded yet. This change defers the preferences initialization so that they comply with the settings style. The change ag/14114425 is reverted due to b/186904496. This change includes a fix for that issue. Test: manually Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.display Bug: 183909540 Bug: 186904496 Change-Id: I317ce251f4d11e62c6592ee587c2919da4d45db3
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.