AccessibilityHearingAidPreferenceController can't be instantiated correctly in tests with the lack of LocalBluetoothManager. This causes null pointer exception when AccessibilityHearingAidPreferenceController.setFragmentManager() is called in AccessibilitySettings.onAttach(). Solution: Mocks the LocalBluetoothManager for tests to successfully instantiate AccessibilityHearingAidPreferenceController to prevent null pointer exception from happening. Bug: 269407238 Test: atest AccessibilitySettingsTest Change-Id: Ibcfffa10b46fd6e85c1b74b03343e5ee0e8843b3
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.