mirror of
https://github.com/bitwarden/mobile
synced 2024-12-25 16:23:43 +01: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
@ -108,6 +108,8 @@ namespace Bit.App
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool HasNavigatedToAccessibilitySettings { get; set; }
|
||||||
|
|
||||||
protected override Window CreateWindow(IActivationState activationState)
|
protected override Window CreateWindow(IActivationState activationState)
|
||||||
{
|
{
|
||||||
//When executing from AutofillExternalActivity we don't have "Options" so we need to filter "manually"
|
//When executing from AutofillExternalActivity we don't have "Options" so we need to filter "manually"
|
||||||
@ -146,6 +148,18 @@ namespace Bit.App
|
|||||||
_hasNavigatedToAutofillWindow = false;
|
_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
|
//If we have an existing MainAppWindow we can use that one
|
||||||
var mainAppWindow = Windows.OfType<MainAppWindow>().FirstOrDefault();
|
var mainAppWindow = Windows.OfType<MainAppWindow>().FirstOrDefault();
|
||||||
if (mainAppWindow != null)
|
if (mainAppWindow != null)
|
||||||
|
@ -158,6 +158,11 @@ namespace Bit.App.Pages
|
|||||||
await MainThread.InvokeOnMainThreadAsync(() => TriggerPropertyChanged(nameof(UseAccessibility)));
|
await MainThread.InvokeOnMainThreadAsync(() => TriggerPropertyChanged(nameof(UseAccessibility)));
|
||||||
return;
|
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();
|
_deviceActionService.OpenAccessibilitySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user