[PR #3047] [PM-6552] Fix for App only showing Home (Login) Page after closed after opening Accessibility Settings #3989

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

Original Pull Request: https://github.com/bitwarden/android/pull/3047

State: closed
Merged: Yes


Type of change

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

Objective

The app is showing the Home Login page when we open the Accessibility Settings on Android from the App and then close the bitwarden app.
This is due to the Accessibility Service being kept alive (and therefore App.xaml.cs). When we open the app again it doesn't try to Navigate to the proper page because of that.
We need to have the app navigate normally even in these scenarios.

Code changes

A workaround similar to the existing one for Autofill can be implemented. It's done separately with a different variable so that the app can handle edge cases where both are needed simultaneously.

  • App.xaml.cs: Added a workaround block similar to the existing one for Autofill. This will basically allow executing Navigations if HasNavigatedToAccessibilitySettings is set to true.
  • AutofillSettingsPageViewModel.android.cs: This is where we set the HasNavigatedToAccessibilitySettings to true so that the next time CreateWindow executes it can set the app to also execute Navigation afterward. Also added #if ANDROID to avoid compile time error.

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
**Original Pull Request:** https://github.com/bitwarden/android/pull/3047 **State:** closed **Merged:** Yes --- ## Type of change - [x] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective The app is showing the Home Login page when we open the Accessibility Settings on Android from the App and then close the bitwarden app. This is due to the Accessibility Service being kept alive (and therefore `App.xaml.cs`). When we open the app again it doesn't try to Navigate to the proper page because of that. We need to have the app navigate normally even in these scenarios. ## Code changes A workaround similar to the existing one for Autofill can be implemented. It's done separately with a different variable so that the app can handle edge cases where both are needed simultaneously. * **App.xaml.cs:** Added a workaround block similar to the existing one for Autofill. This will basically allow executing Navigations if `HasNavigatedToAccessibilitySettings` is set to true. * **AutofillSettingsPageViewModel.android.cs:** This is where we set the `HasNavigatedToAccessibilitySettings` to true so that the next time CreateWindow executes it can set the app to also execute Navigation afterward. Also added `#if ANDROID` to avoid compile time error. ## 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
GiteaMirror added the pull-request label 2025-11-26 23:39:18 -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#3989