Symptom: Once the work profile component of the tile is disabled after Settings preloaded tiles, Settings will crash when the user clicks the work option from the profile selection dialog. Root cause: Settings just checks the users from the preloaded tiles to prompt profile selection dialog. It doesn’t check the activity for the work profile user before launching. Solution: Resolve the activity by intent as users before launching if the work profile is enabled. Directly start activity if only one user is resolvable, otherwise prompt a dialog for profile selection. Fixes: 162227425 Test: make RunSettingsRoboTests Change-Id: Idcc4e5a266ab2a2252db30bb97d4be002212c677
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.