* Don't keep Settings observers longer than start-stop. * Only call updateState() once on controllers during create->start->resume. * Remove some duplicate controller update methods from ZenModesFragmentBase (we can directly call DashboardFragment's). * Don't update controllers if unrelated modes were changed. * Extract ZenSettingsObserver for use in the link tile later. * Add tests. Fixes: 353946788 Test: atest com.android.settings.notification.modes Flag: android.app.modes_ui Change-Id: I64b51714d699b5c3a592a76fcb615d2999998829
Running Settings Robolectric tests
The full suite
$ croot
$ atest SettingsRoboTests
Running a single test class
With a filter
$ croot
$ atest SettingsRoboTests:com.android.settings.display.AdaptiveSleepPreferenceControllerTest
You can also run any single test class with atest (it will try to find the correct path)
$ atest AdaptiveSleepPreferenceControllerTest