[PR #1626] [MERGED] Supress lock and logout when showing fileswitcher on Android #3011

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1626
Author: @jlf0dev
Created: 11/2/2021
Status: Merged
Merged: 1/19/2022
Merged by: @jlf0dev

Base: masterHead: bug/vault-timeout-immediate-file


📝 Commits (3)

  • 88565c1 Supress lock and logout when showing fileswitcher on Android
  • aae4d8e Merge branch 'master' into bug/vault-timeout-immediate-file
  • 62cbcab convert suppress bool to delay long

📊 Changes

4 files changed (+36 additions, -38 deletions)

View changed files

📝 src/App/App.xaml.cs (+3 -28)
📝 src/App/Pages/Vault/AttachmentsPageViewModel.cs (+7 -0)
📝 src/Core/Abstractions/IVaultTimeoutService.cs (+1 -0)
📝 src/Core/Services/VaultTimeoutService.cs (+25 -10)

📄 Description

Type of change

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

Objective

If vault timeout was set to "Immediate", the file picker on Android was locking and logging out Bitwarden. This meant you could never choose a file.

This fix adds a DelayLockAndLogoutMs long to the VaultTimeoutService and sets it to 60 seconds while choosing an attachment on Android.

I also removed the extraneous logic for lock/logout from App.xaml.cs. I consolidated this logic in CheckVaultTimeoutAsync() inside the VaultTimeoutService.

Code changes

  • IVaultTimeoutService.cs: Add DelayLockAndLogoutMs long to TimeoutService
  • VaultTimeoutService.cs: Add logic to check for DelayLockAndLogoutMs when checking VaultTimeout settings
  • AttachmentsPageViewModel.cs: If Android, set DelayLockAndLogoutMs to 60s before showing filepicker
  • App.xaml.cs: Reset DelayLockAndLogoutMs and move lock/logout logic to VaultTimeoutService

Screenshots

Testing requirements

  • User can pick an attachment while the VaultTimeout option is set to "Immediate"
  • Functionality of VaultTimeout still works

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/1626 **Author:** [@jlf0dev](https://github.com/jlf0dev) **Created:** 11/2/2021 **Status:** ✅ Merged **Merged:** 1/19/2022 **Merged by:** [@jlf0dev](https://github.com/jlf0dev) **Base:** `master` ← **Head:** `bug/vault-timeout-immediate-file` --- ### 📝 Commits (3) - [`88565c1`](https://github.com/bitwarden/android/commit/88565c15d0a8226488b5aaf097eb2e7fa7c487bd) Supress lock and logout when showing fileswitcher on Android - [`aae4d8e`](https://github.com/bitwarden/android/commit/aae4d8e9972bd341a6ceee8664817e6bf26cb5e9) Merge branch 'master' into bug/vault-timeout-immediate-file - [`62cbcab`](https://github.com/bitwarden/android/commit/62cbcab3bcae57bc1e2a46561f1f25a2f041ea3e) convert suppress bool to delay long ### 📊 Changes **4 files changed** (+36 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `src/App/App.xaml.cs` (+3 -28) 📝 `src/App/Pages/Vault/AttachmentsPageViewModel.cs` (+7 -0) 📝 `src/Core/Abstractions/IVaultTimeoutService.cs` (+1 -0) 📝 `src/Core/Services/VaultTimeoutService.cs` (+25 -10) </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--> If vault timeout was set to "Immediate", the file picker on Android was locking and logging out Bitwarden. This meant you could never choose a file. This fix adds a `DelayLockAndLogoutMs` long to the VaultTimeoutService and sets it to 60 seconds while choosing an attachment on Android. I also removed the extraneous logic for lock/logout from App.xaml.cs. I consolidated this logic in `CheckVaultTimeoutAsync()` inside the VaultTimeoutService. ## 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--> * **IVaultTimeoutService.cs:** Add DelayLockAndLogoutMs long to TimeoutService * **VaultTimeoutService.cs:** Add logic to check for DelayLockAndLogoutMs when checking VaultTimeout settings * **AttachmentsPageViewModel.cs:** If Android, set DelayLockAndLogoutMs to 60s before showing filepicker * **App.xaml.cs:** Reset DelayLockAndLogoutMs and move lock/logout logic to VaultTimeoutService ## Screenshots <!--Required for any UI changes. Delete if not applicable--> ## Testing requirements <!--What functionality requires testing by QA? This includes testing new behavior and regression testing--> - User can pick an attachment while the VaultTimeout option is set to "Immediate" - Functionality of VaultTimeout still works ## 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:27:07 -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#3011