[PR #6103] [MERGED] [PM-27150] React to device changes on device screen unlock method #43409

Closed
opened 2026-04-23 22:02:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6103
Author: @andrebispo5
Created: 10/31/2025
Status: Merged
Merged: 11/18/2025
Merged by: @andrebispo5

Base: mainHead: pm-27150/authenticator-unlock-enabled-bug


📝 Commits (10+)

  • e55b8b7 [PM-27150] React to device changes on device screen unlock method.
  • 3533af5 [PM-27150] Add BiometricUnlockKey flow to AuthDiskSouce
  • 46c1cb3 [PM-27150] Add isUnlockWithBiometricsEnabledFlow to SettingsRepository
  • 436bcc1 [PM-27150] Remove saved biometric key if device no longer supports it.
  • 793e798 [PM-27150] Bypass UnlockScreen if device no longer supports it.
  • 3ce913d [PM-27150] Update AppLock row visibility and toggle based on device biometric support.
  • e7ac063 [PM-27150] Add PR suggestions.
  • 85ff4e7 [PM-27150] Fix typo
  • de0947a [PM-27150] Add replay 1
  • 12c28c2 Merge branch 'main' into pm-27150/authenticator-unlock-enabled-bug

📊 Changes

20 files changed (+944 additions, -15 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSource.kt (+1 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceImpl.kt (+1 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryImpl.kt (+1 -1)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceTest.kt (+21 -2)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/util/FakeAuthDiskSource.kt (+1 -1)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/auth/datasource/disk/AuthDiskSource.kt (+6 -0)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/auth/datasource/disk/AuthDiskSourceImpl.kt (+12 -0)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/repository/SettingsRepository.kt (+5 -0)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/repository/SettingsRepositoryImpl.kt (+11 -0)
authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/components/biometrics/BiometricChanges.kt (+38 -0)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/feature/rootnav/RootNavScreen.kt (+14 -1)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/feature/rootnav/RootNavViewModel.kt (+30 -5)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/feature/settings/SettingsScreen.kt (+12 -3)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/feature/settings/SettingsViewModel.kt (+43 -0)
📝 authenticator/src/test/kotlin/com/bitwarden/authenticator/data/auth/datasource/disk/util/FakeAuthDiskSource.kt (+12 -0)
📝 authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/repository/SettingsRepositoryTest.kt (+15 -0)
authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/rootnav/RootNavScreenTest.kt (+314 -0)
authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/rootnav/RootNavViewModelTest.kt (+369 -0)
📝 authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/settings/SettingsScreenTest.kt (+18 -0)
📝 authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/settings/SettingsViewModelTest.kt (+20 -0)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-27150

📔 Objective

This pull request improves how the Authenticator app handles biometric authentication, especially in scenarios where the device's biometric setup changes (e.g., biometrics are disabled or removed). The main focus is on ensuring that the app responds appropriately if biometrics are no longer available, both in navigation logic and in the settings UI.

Biometric Authentication Handling Improvements:

  • The app now checks if biometrics are supported before navigating to the unlock screen; if not, it triggers a new action to clear the biometric key and unlocks the app instead.
  • Added the ClearBiometricsKey action to RootNavAction.Internal, with corresponding handling in RootNavViewModel to clear the key and update navigation state.

Settings Screen Enhancements:

  • The settings screen now rechecks biometric support whenever the app resumes (comes to the foreground), disabling biometric unlock in the app if biometrics are no longer supported on the device.
  • The conditional rendering of the "Unlock with Biometrics" row is now based on a state variable that updates with lifecycle events, ensuring the UI reflects the current device biometric status.

Dependency Injection and Imports:

  • BiometricsManager is now injected into RootNavScreen using LocalBiometricsManager, and necessary imports have been added to support these changes.

📸 Screenshots

https://github.com/user-attachments/assets/f41d9899-d05d-40a7-a142-0e614d059f12

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 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/6103 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 10/31/2025 **Status:** ✅ Merged **Merged:** 11/18/2025 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `main` ← **Head:** `pm-27150/authenticator-unlock-enabled-bug` --- ### 📝 Commits (10+) - [`e55b8b7`](https://github.com/bitwarden/android/commit/e55b8b7f2c07305dc254b595000a26eef6d97a01) [PM-27150] React to device changes on device screen unlock method. - [`3533af5`](https://github.com/bitwarden/android/commit/3533af50948284f638a3319bfb540f3ec9b5b895) [PM-27150] Add BiometricUnlockKey flow to AuthDiskSouce - [`46c1cb3`](https://github.com/bitwarden/android/commit/46c1cb36dd548ef0b90709bf91e10c82d511afe1) [PM-27150] Add isUnlockWithBiometricsEnabledFlow to SettingsRepository - [`436bcc1`](https://github.com/bitwarden/android/commit/436bcc15a260a45882e1fb566cc75eafabc0b43a) [PM-27150] Remove saved biometric key if device no longer supports it. - [`793e798`](https://github.com/bitwarden/android/commit/793e7988f491bccc94748aca03330728300cdedb) [PM-27150] Bypass UnlockScreen if device no longer supports it. - [`3ce913d`](https://github.com/bitwarden/android/commit/3ce913d80e0b274769f97381cf858149a95f5c77) [PM-27150] Update AppLock row visibility and toggle based on device biometric support. - [`e7ac063`](https://github.com/bitwarden/android/commit/e7ac0631a9475cdd7983ae71aebe21f5329e37c5) [PM-27150] Add PR suggestions. - [`85ff4e7`](https://github.com/bitwarden/android/commit/85ff4e73ac204497ec6065a3ac2dfc118f0f7084) [PM-27150] Fix typo - [`de0947a`](https://github.com/bitwarden/android/commit/de0947a9b5d7c7580e2725666804b7184bf4558e) [PM-27150] Add replay 1 - [`12c28c2`](https://github.com/bitwarden/android/commit/12c28c27e28aa8fa0d2a7828fef2bf13b9f8dad5) Merge branch 'main' into pm-27150/authenticator-unlock-enabled-bug ### 📊 Changes **20 files changed** (+944 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSource.kt` (+1 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceImpl.kt` (+1 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryImpl.kt` (+1 -1) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceTest.kt` (+21 -2) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/util/FakeAuthDiskSource.kt` (+1 -1) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/auth/datasource/disk/AuthDiskSource.kt` (+6 -0) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/auth/datasource/disk/AuthDiskSourceImpl.kt` (+12 -0) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/repository/SettingsRepository.kt` (+5 -0) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/repository/SettingsRepositoryImpl.kt` (+11 -0) ➕ `authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/components/biometrics/BiometricChanges.kt` (+38 -0) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/feature/rootnav/RootNavScreen.kt` (+14 -1) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/feature/rootnav/RootNavViewModel.kt` (+30 -5) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/feature/settings/SettingsScreen.kt` (+12 -3) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/feature/settings/SettingsViewModel.kt` (+43 -0) 📝 `authenticator/src/test/kotlin/com/bitwarden/authenticator/data/auth/datasource/disk/util/FakeAuthDiskSource.kt` (+12 -0) 📝 `authenticator/src/test/kotlin/com/bitwarden/authenticator/data/platform/repository/SettingsRepositoryTest.kt` (+15 -0) ➕ `authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/rootnav/RootNavScreenTest.kt` (+314 -0) ➕ `authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/rootnav/RootNavViewModelTest.kt` (+369 -0) 📝 `authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/settings/SettingsScreenTest.kt` (+18 -0) 📝 `authenticator/src/test/kotlin/com/bitwarden/authenticator/ui/platform/feature/settings/SettingsViewModelTest.kt` (+20 -0) </details> ### 📄 Description ## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> https://bitwarden.atlassian.net/browse/PM-27150 ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> This pull request improves how the Authenticator app handles biometric authentication, especially in scenarios where the device's biometric setup changes (e.g., biometrics are disabled or removed). The main focus is on ensuring that the app responds appropriately if biometrics are no longer available, both in navigation logic and in the settings UI. **Biometric Authentication Handling Improvements:** * The app now checks if biometrics are supported before navigating to the unlock screen; if not, it triggers a new action to clear the biometric key and unlocks the app instead. * Added the `ClearBiometricsKey` action to `RootNavAction.Internal`, with corresponding handling in `RootNavViewModel` to clear the key and update navigation state. **Settings Screen Enhancements:** * The settings screen now rechecks biometric support whenever the app resumes (comes to the foreground), disabling biometric unlock in the app if biometrics are no longer supported on the device. * The conditional rendering of the "Unlock with Biometrics" row is now based on a state variable that updates with lifecycle events, ensuring the UI reflects the current device biometric status. **Dependency Injection and Imports:** * `BiometricsManager` is now injected into `RootNavScreen` using `LocalBiometricsManager`, and necessary imports have been added to support these changes. ## 📸 Screenshots <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> https://github.com/user-attachments/assets/f41d9899-d05d-40a7-a142-0e614d059f12 ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <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 2026-04-23 22:02:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#43409