Fix vault timeout immediately on Android Fido2 autofill, where it was locking immediately after user unlocks because changing activity
Code changes
CredentialProviderSelectionActivity: Changed NoHistory to false so we can launch the MainActivity and return to this one. Added the activity launcher so we can launch MainActivity to unlock the vault after the user selects the cipher to autofill which confirms unlock on the callback.
Fido2GetAssertionUserInterface: Added _unlockVaultTcs so we can await until the user unlocks on immediate timeout vaults to ensure vault is unlocked for the Fido2 flow.
DeviceActionService: Added a new CredentialProviderConstants.Fido2CredentialNeedsUnlockingAgainBecauseImmediateTimeout to have a way to know after unlocking that is because of this scenario and then set the result back. Here a caveat is that we set vaultTimeoutService.DelayLockAndLogoutMs in order to maintain a time window of the vault unlocked for this flow. Otherwise it'll be immediately locked after the MainActivity is finished.
Before you submit
Please check for formatting errors (dotnet format --verify-no-changes) (required)
Please add unit tests where it makes sense to do so (encouraged but not required)
If this change requires a documentation update - notify the documentation team
If this change has particular deployment requirements - notify the DevOps team
Type of change
Objective
Fix vault timeout immediately on Android Fido2 autofill, where it was locking immediately after user unlocks because changing activity
Code changes
NoHistory
tofalse
so we can launch theMainActivity
and return to this one. Added the activity launcher so we can launchMainActivity
to unlock the vault after the user selects the cipher to autofill which confirms unlock on the callback._unlockVaultTcs
so we can await until the user unlocks on immediate timeout vaults to ensure vault is unlocked for the Fido2 flow.CredentialProviderConstants.Fido2CredentialNeedsUnlockingAgainBecauseImmediateTimeout
to have a way to know after unlocking that is because of this scenario and then set the result back. Here a caveat is that we setvaultTimeoutService.DelayLockAndLogoutMs
in order to maintain a time window of the vault unlocked for this flow. Otherwise it'll be immediately locked after theMainActivity
is finished.Before you submit
dotnet format --verify-no-changes
) (required)