During a run of the setup wizard, a tester one time encountered a case where the 'Accept Legal terms' screen followed by the Security screen showed for a second time after already confirming the pattern in the Security screen. The logs showed a crash in FingerprintEnrollFindSensor.onActivityResult which could only have happened if it was called with a requestCode of CONFIRM_REQUEST and a resultCode of RESULT_OK, but a null Intent. This isn't an expected flow, and AFAIK we haven't been able to reproduce the original problem, but it seems reasonable to at least not crash in settings, so this CL defends against that crash by just calling finish() in this case, which means the caller who started the FingerprintEnrollFindSensor will see the default result code of Activity.RESULT_CANCELLED. Bug: 80099085 Test: make -j RunSettingsRoboTests Change-Id: I94401eabe295e4d5396cf7d324fbf1902dc45f6d
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.