mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 07:05:35 +03:00
PM-6552 Fix for App only showing Home (Login) Page after closed after opening Accessibility Settings (#3047)
This commit is contained in:
parent
6f32afb919
commit
602627b5fa
2 changed files with 19 additions and 0 deletions
|
@ -108,6 +108,8 @@ namespace Bit.App
|
|||
}
|
||||
}
|
||||
|
||||
public bool HasNavigatedToAccessibilitySettings { get; set; }
|
||||
|
||||
protected override Window CreateWindow(IActivationState activationState)
|
||||
{
|
||||
//When executing from AutofillExternalActivity we don't have "Options" so we need to filter "manually"
|
||||
|
@ -146,6 +148,18 @@ namespace Bit.App
|
|||
_hasNavigatedToAutofillWindow = false;
|
||||
}
|
||||
|
||||
// WORKAROUND: This workaround is similar to the one above (_hasNavigatedToAutofillWindow) related with Accessibility Services but this one specifically
|
||||
// is due to trying to open the Accessibility Settings Page for enabled/disabling
|
||||
if(HasNavigatedToAccessibilitySettings)
|
||||
{
|
||||
homePage.PerformNavigationOnAccountChangedOnLoad = true;
|
||||
// this is needed because when coming back from AutofillWindow OnResume won't be called and we need this flag
|
||||
// so that void Navigate(NavigationTarget navTarget, INavigationParams navParams) doesn't enqueue the navigation
|
||||
// and it performs it directly.
|
||||
_isResumed = true;
|
||||
HasNavigatedToAccessibilitySettings = false;
|
||||
}
|
||||
|
||||
//If we have an existing MainAppWindow we can use that one
|
||||
var mainAppWindow = Windows.OfType<MainAppWindow>().FirstOrDefault();
|
||||
if (mainAppWindow != null)
|
||||
|
|
|
@ -158,6 +158,11 @@ namespace Bit.App.Pages
|
|||
await MainThread.InvokeOnMainThreadAsync(() => TriggerPropertyChanged(nameof(UseAccessibility)));
|
||||
return;
|
||||
}
|
||||
|
||||
#if ANDROID
|
||||
// WORKAROUND: Set workaround property to avoid an issue when launching the app after being in Accessibility Settings. More Info on App.xaml.cs
|
||||
((App)Application.Current).HasNavigatedToAccessibilitySettings = true;
|
||||
#endif
|
||||
_deviceActionService.OpenAccessibilitySettings();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue