1) Fix the condition to check either subscribed or null. 2) Don't register listeners unless the feature flag is enabled Test: make RunSettingsRoboTest Bug: 267357231 Change-Id: I0134812cbac60c394d96c5a5621a7c16d781b05d
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.