[PR #1220] [MERGED] Restore vault timeout timer for Android #2796

Closed
opened 2025-11-26 23:24:13 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1220
Author: @mpbw2
Created: 1/15/2021
Status: Merged
Merged: 1/15/2021
Merged by: @mpbw2

Base: masterHead: android-restore-lock-timers


📝 Commits (1)

  • 6326750 restore vault timeout timer for Android

📊 Changes

10 files changed (+44 additions, -21 deletions)

View changed files

📝 src/Android/MainActivity.cs (+18 -1)
📝 src/Android/Services/DeviceActionService.cs (+1 -1)
📝 src/App/App.xaml.cs (+7 -2)
📝 src/App/Pages/BaseContentPage.cs (+1 -1)
📝 src/App/Services/MobileStorageService.cs (+1 -1)
📝 src/Core/Constants.cs (+1 -1)
📝 src/Core/Services/VaultTimeoutService.cs (+9 -8)
📝 src/iOS.Core/Services/DeviceActionService.cs (+3 -3)
📝 src/iOS.Core/Utilities/iOSHelpers.cs (+2 -2)
📝 src/iOS/AppDelegate.cs (+1 -1)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/1220 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 1/15/2021 **Status:** ✅ Merged **Merged:** 1/15/2021 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `android-restore-lock-timers` --- ### 📝 Commits (1) - [`6326750`](https://github.com/bitwarden/android/commit/6326750aafb4ae7448e7dd3a2d1048498adc382c) restore vault timeout timer for Android ### 📊 Changes **10 files changed** (+44 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/MainActivity.cs` (+18 -1) 📝 `src/Android/Services/DeviceActionService.cs` (+1 -1) 📝 `src/App/App.xaml.cs` (+7 -2) 📝 `src/App/Pages/BaseContentPage.cs` (+1 -1) 📝 `src/App/Services/MobileStorageService.cs` (+1 -1) 📝 `src/Core/Constants.cs` (+1 -1) 📝 `src/Core/Services/VaultTimeoutService.cs` (+9 -8) 📝 `src/iOS.Core/Services/DeviceActionService.cs` (+3 -3) 📝 `src/iOS.Core/Utilities/iOSHelpers.cs` (+2 -2) 📝 `src/iOS/AppDelegate.cs` (+1 -1) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:24:13 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#2796