[PR #1820] [MERGED] Fix for biometric lock state overlap #3155

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1820
Author: @mpbw2
Created: 2/28/2022
Status: Merged
Merged: 3/1/2022
Merged by: @mpbw2

Base: masterHead: bugfix-biolockstate


📝 Commits (1)

  • 1c8694a support for per-user biometric state tracking

📊 Changes

9 files changed (+43 additions, -26 deletions)

View changed files

📝 src/App/Pages/Accounts/LockPageViewModel.cs (+2 -2)
📝 src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs (+1 -1)
📝 src/App/Utilities/AppHelpers.cs (+0 -1)
📝 src/Core/Abstractions/IStateService.cs (+2 -1)
📝 src/Core/Models/Domain/Account.cs (+5 -4)
📝 src/Core/Services/AuthService.cs (+1 -1)
📝 src/Core/Services/StateService.cs (+26 -11)
📝 src/Core/Services/VaultTimeoutService.cs (+4 -3)
📝 src/iOS.Core/Controllers/LockPasswordViewController.cs (+2 -2)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

While working on this I discovered I could confuse the app into changing the biometric lock state for non-active accounts. The bio-lock state is now tracked per-account.

Code changes

  • Account.cs: Added BiometricLocked bool to AccountKeys and renamed it to AccountVolatileData since it's no longer just keys (this object is never written to storage)
  • StateService.cs: Replaced BiometricLocked property with dedicated methods to use the Account object
  • AppHelpers.cs: Removed the call to set BiometricLocked as it's now handled within the call to LogoutAccountAsync above it
  • Everything else: Update syntax to support new async Get/Set BiometricLocked methods in StateService

Testing requirements

Configure multiple accounts with biometric unlock enabled and varying timeout durations. Terminate and restart the app, perform bio unlock, then switch to another account. Bio unlock should automatically prompt (instead of requiring the user to press "Unlock with Biometrics" on the lock screen)

Before you submit

  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 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/1820 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 2/28/2022 **Status:** ✅ Merged **Merged:** 3/1/2022 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `bugfix-biolockstate` --- ### 📝 Commits (1) - [`1c8694a`](https://github.com/bitwarden/android/commit/1c8694a3145c4a6de065efd0aa22ecdc12f0de8a) support for per-user biometric state tracking ### 📊 Changes **9 files changed** (+43 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Accounts/LockPageViewModel.cs` (+2 -2) 📝 `src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs` (+1 -1) 📝 `src/App/Utilities/AppHelpers.cs` (+0 -1) 📝 `src/Core/Abstractions/IStateService.cs` (+2 -1) 📝 `src/Core/Models/Domain/Account.cs` (+5 -4) 📝 `src/Core/Services/AuthService.cs` (+1 -1) 📝 `src/Core/Services/StateService.cs` (+26 -11) 📝 `src/Core/Services/VaultTimeoutService.cs` (+4 -3) 📝 `src/iOS.Core/Controllers/LockPasswordViewController.cs` (+2 -2) </details> ### 📄 Description ## Type of change - [X] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> While working on [this](https://github.com/bitwarden/mobile/pull/1818) I discovered I could confuse the app into changing the biometric lock state for non-active accounts. The bio-lock state is now tracked per-account. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **Account.cs:** Added `BiometricLocked` bool to `AccountKeys` and renamed it to `AccountVolatileData` since it's no longer just keys (this object is never written to storage) * **StateService.cs:** Replaced `BiometricLocked` property with dedicated methods to use the `Account` object * **AppHelpers.cs:** Removed the call to set `BiometricLocked` as it's now handled within the call to `LogoutAccountAsync` above it * **Everything else:** Update syntax to support new async Get/Set BiometricLocked methods in `StateService` ## Testing requirements <!--What functionality requires testing by QA? This includes testing new behavior and regression testing--> Configure multiple accounts with biometric unlock enabled and varying timeout durations. Terminate and restart the app, perform bio unlock, then switch to another account. Bio unlock should automatically prompt (instead of requiring the user to press "Unlock with Biometrics" on the lock screen) ## Before you submit - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <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:29:01 -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#3155