Root Cause: TextUtils.isEmpty() will return true both null and empty case, and write config key into it. Solution: Write config key only if settings key is null. That means no one (developers or users) touch the key ever, so we should respect config key here. Bug: 255912415 Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragmentTest Change-Id: I092975ea3de8fce78b7ae2a6241a30f6af8125a6
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.