mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 18:38:27 +03:00
fix lock checks on sleep of app
This commit is contained in:
parent
9164c9b946
commit
2062a284e3
1 changed files with 15 additions and 4 deletions
|
@ -188,8 +188,12 @@ namespace Bit.App
|
||||||
System.Diagnostics.Debug.WriteLine("XF App: OnSleep");
|
System.Diagnostics.Debug.WriteLine("XF App: OnSleep");
|
||||||
if(Device.RuntimePlatform == Device.Android)
|
if(Device.RuntimePlatform == Device.Android)
|
||||||
{
|
{
|
||||||
await _storageService.SaveAsync(Constants.LastActiveKey, DateTime.UtcNow);
|
var isLocked = await _lockService.IsLockedAsync();
|
||||||
SetTabsPageFromAutofill();
|
if(!isLocked)
|
||||||
|
{
|
||||||
|
await _storageService.SaveAsync(Constants.LastActiveKey, DateTime.UtcNow);
|
||||||
|
}
|
||||||
|
SetTabsPageFromAutofill(isLocked);
|
||||||
await SleptAsync();
|
await SleptAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -319,7 +323,7 @@ namespace Bit.App
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetTabsPageFromAutofill()
|
private void SetTabsPageFromAutofill(bool isLocked)
|
||||||
{
|
{
|
||||||
if(Device.RuntimePlatform == Device.Android && !string.IsNullOrWhiteSpace(_appOptions.Uri) &&
|
if(Device.RuntimePlatform == Device.Android && !string.IsNullOrWhiteSpace(_appOptions.Uri) &&
|
||||||
!_appOptions.FromAutofillFramework)
|
!_appOptions.FromAutofillFramework)
|
||||||
|
@ -328,8 +332,15 @@ namespace Bit.App
|
||||||
{
|
{
|
||||||
Device.BeginInvokeOnMainThread(() =>
|
Device.BeginInvokeOnMainThread(() =>
|
||||||
{
|
{
|
||||||
Current.MainPage = new TabsPage();
|
|
||||||
_appOptions.Uri = null;
|
_appOptions.Uri = null;
|
||||||
|
if(isLocked)
|
||||||
|
{
|
||||||
|
Current.MainPage = new NavigationPage(new LockPage());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Current.MainPage = new TabsPage();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue