Aissign the value of mPrefrence when displayPrefrence() being called. This can fix the preference doesn't get updated bug. Added test to ensure it. Bug: 160169699 Test: make RunSettingsRoboTests ROBOTEST_FILTER=AllInOneTetherPreferenceController Change-Id: If0e7ce421cc46cff2b92837d2d07ea0ff4dc5fd9
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.