[PR #2395] [MERGED] [PM-1249] Clear/reset password/PIN fields on login/lock screen when app is backgrounded #3539

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2395
Author: @mpbw2
Created: 3/1/2023
Status: Merged
Merged: 3/7/2023
Merged by: @mpbw2

Base: masterHead: bugfix/app-bg-clear-fields


📝 Commits (3)

  • 5402ad0 [PM-1249] Clear/reset password/PIN fields on login/lock screen when app is backgrounded
  • c6cabe3 fixes
  • 5cb128a Merge branch 'master' into bugfix/app-bg-clear-fields

📊 Changes

6 files changed (+76 additions, -2 deletions)

View changed files

📝 src/App/App.xaml.cs (+10 -0)
📝 src/App/Pages/Accounts/LockPage.xaml.cs (+12 -0)
📝 src/App/Pages/Accounts/LockPageViewModel.cs (+29 -2)
📝 src/App/Pages/Accounts/LoginPage.xaml.cs (+11 -0)
📝 src/App/Pages/Accounts/LoginPageViewModel.cs (+13 -0)
📝 src/Core/Constants.cs (+1 -0)

📄 Description

Type of change

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

Objective

When backgrounding the app, clear any partially-filled text in the password and/or PIN fields on the login and lock screens. Also reset the visibility toggle to default (not visible) to prevent any accidental reveals when entering password/pin after foregrounding the app.

Code changes

  • App.xaml.cs: Added new ClearSensitiveFieldsAsync method to send ClearSensitiveFields message, called from both SleptAsync and ResumedAsync
  • LockPage/LoginPage.xaml.cs: Registered BroadcasterService to handle ClearSensitiveFields message and call method to set fields to string.Empty and ShowPassword to false
  • LockPageViewModel.cs: Added _masterPassword and _pin backing vars to allow for programmatic clearing

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

🔄 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/2395 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 3/1/2023 **Status:** ✅ Merged **Merged:** 3/7/2023 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `bugfix/app-bg-clear-fields` --- ### 📝 Commits (3) - [`5402ad0`](https://github.com/bitwarden/android/commit/5402ad06edfd5f5c9cfa3e5e409f11954858324b) [PM-1249] Clear/reset password/PIN fields on login/lock screen when app is backgrounded - [`c6cabe3`](https://github.com/bitwarden/android/commit/c6cabe395d7859725900ec6485dbbe65d892fc6e) fixes - [`5cb128a`](https://github.com/bitwarden/android/commit/5cb128ab89505e593407a4eee608f13b6bf55676) Merge branch 'master' into bugfix/app-bg-clear-fields ### 📊 Changes **6 files changed** (+76 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/App/App.xaml.cs` (+10 -0) 📝 `src/App/Pages/Accounts/LockPage.xaml.cs` (+12 -0) 📝 `src/App/Pages/Accounts/LockPageViewModel.cs` (+29 -2) 📝 `src/App/Pages/Accounts/LoginPage.xaml.cs` (+11 -0) 📝 `src/App/Pages/Accounts/LoginPageViewModel.cs` (+13 -0) 📝 `src/Core/Constants.cs` (+1 -0) </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--> When backgrounding the app, clear any partially-filled text in the password and/or PIN fields on the login and lock screens. Also reset the visibility toggle to default (not visible) to prevent any accidental reveals when entering password/pin after foregrounding the app. ## 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--> * **App.xaml.cs:** Added new `ClearSensitiveFieldsAsync` method to send `ClearSensitiveFields` message, called from both `SleptAsync` and `ResumedAsync` * **LockPage/LoginPage.xaml.cs:** Registered `BroadcasterService` to handle `ClearSensitiveFields` message and call method to set fields to `string.Empty` and `ShowPassword` to `false` * **LockPageViewModel.cs:** Added `_masterPassword` and `_pin` backing vars to allow for programmatic clearing ## 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 --- <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:34:08 -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#3539