Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore vault timeout timer for Android #1220

Merged
merged 1 commit into from
Jan 15, 2021
Merged

Conversation

mpbw2
Copy link
Contributor

@mpbw2 mpbw2 commented Jan 15, 2021

This PR restores the vault timeout timer in Android in a way that coexists with the new locking mechanism, since we're unable to reproduce the failure of the new mechanism reported elsewhere. It is my hope that we can remove the timer (again) once we're able to establish what is behind the failure on some devices.

Note that the restored timer is only utilized as a trigger (like before) but the actual time comparison is still using the new monotonic clock value. If for some reason this still doesn't work, we can be reasonably sure that the problem lies with the returned value and not the way the lock trigger is fired.

Also changed:

  • Normalized elapsed time to milliseconds instead of seconds so we can perform time checks with multiplication instead of division (Desperation Level 1)
  • Changed name of last active pref key to make sure there's no possible overlap with old DateTime pref value (Desperation Level 2)
  • Var name tweaks to make time comparison blocks more troubleshoot-able (Desperation Level 2.5)

Tested both mechanisms together and independently (by disabling the other) across several devices successfully.

@mpbw2 mpbw2 requested a review from a team January 15, 2021 16:55
Copy link

@cscharf cscharf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hope you don't get to desperation level 3 😉 , looks good! 🤞🏻

@mpbw2 mpbw2 merged commit 56935a7 into master Jan 15, 2021
@mpbw2 mpbw2 deleted the android-restore-lock-timers branch January 15, 2021 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android - Bitwarden does not lock after the Vault Timeout duration passes.
2 participants