OSDN Git Service

Don't crash on null Intent in FingerprintEnrollFindSensor
authorAntony Sargent <asargent@google.com>
Thu, 31 May 2018 19:49:46 +0000 (12:49 -0700)
committerAntony Sargent <asargent@google.com>
Thu, 31 May 2018 21:22:38 +0000 (14:22 -0700)
commit9ceb587ede0c89c597e0c417018b16997c561c0f
treeb0796c399fd05e7aca6ce9c598860267a99172c1
parent09df7d707106339980a148a352dd801d6c6a0b4b
Don't crash on null Intent in FingerprintEnrollFindSensor

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
src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java
tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollFindSensorTest.java