fix: reset stage when scanner is cancelled - #362
xhon-pelushi wants to merge 2 commits into
Conversation
Stage.Auditee and Stage.EnableRemoteVerify only reset to Stage.None inside the RESULT_OK branch of the scanner's ActivityResultLauncher callback. Backing out of the camera activity (RESULT_CANCELED) left stage stuck at Auditee/EnableRemoteVerify with no content generated yet. A later configuration change then hid the buttons in onCreate's onPreDraw listener without restoring any content, leaving only the toolbar visible. Fixes GrapheneOS#323
|
Flagging an overlap so a maintainer does not have to find it: #370 (@munzzyy) fixes the same bug, The first hunk is the same change — mine is But theirs has a second hunk that I missed: I opened this on 13 August and theirs is from 9 September, so this one is first in time — but
I would lean towards the first, since #370 already has it written. |
|
Thanks for reading both and saying which one covers more. The permission-denied path is the half that matters, since it leaves the stage stuck the same way. Happy either way, and it is the maintainers' call: close this for #370, or I close #370 and you add that hunk here. Whichever way it goes I will drop mine so only one stays open. |
The camera-permission-denied branch of onRequestPermissionsResult left stage at Auditee/EnableRemoteVerify, the same stuck state the scanner RESULT_CANCELED path had: the scan never launches, no content is generated, and a later configuration change hides the buttons leaving only the toolbar. Reset stage to None there too. Credit to GrapheneOS#370 for spotting this second path.
|
I've added the second path here: @munzzyy since you offered to drop yours either way, no objection from me to closing #370 in favour of this, but it's the maintainers' call. Either way happy to end up with one PR. |
Reset attestation UI stage when the user backs out of the camera scanner without RESULT_OK.
Fixes #323
Test plan