- Because b/209906859 needs to add WiFi service check for WiFi-less pixel project. - But mWifiManager has not been initialized before the addWifiSwitchPreferenceController() function, which will cause the controller to not handle the WiFi switching UI. - Add a hasWifiManager() function to initialize the WiFi manager and handle related functions. Bug: 212211915 Test: manual test make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest Change-Id: Idc0d4cdc31403f0ab9a4eb787e4c70be605f7ddb
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.