We need to make the show sensitive content switch checked by default. The old implementation misses calling to super.updateState(), which caused lacking of UI refreshment. This change also added validation to the preference id that is used to construct the LockScreenNotificationShowSensitiveController, which avoids misusage. Added unit tests to verify that the UI is also updated upon Settings change, and the preference IDs are verified. Fix: 392621932 Flag: com.android.server.notification.notification_lock_screen_settings Test: manual Change-Id: I31fe602d5b5439515e5fdf5c706b420edaf79042
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