1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-09 12:03:16 +00:00

android checklock

This commit is contained in:
Kyle Spearrin
2016-06-04 22:35:03 -04:00
parent 1c4de107b9
commit 6a5d40b3ef
2 changed files with 49 additions and 5 deletions

View File

@@ -60,12 +60,22 @@ namespace Bit.App
{
// Handle when your app sleeps
Debug.WriteLine("OnSleep");
if(Device.OS == TargetPlatform.Android)
{
_settings.AddOrUpdateValue(Constants.SettingLastBackgroundedDate, DateTime.UtcNow);
}
}
protected override void OnResume()
{
// Handle when your app resumes
Debug.WriteLine("OnResume");
if(Device.OS == TargetPlatform.Android)
{
CheckLockAsync(false);
}
}
private async Task CheckLockAsync(bool forceLock)
@@ -100,12 +110,9 @@ namespace Bit.App
var pinUnlock = _settings.GetValueOrDefault<bool>(Constants.SettingPinUnlockOn);
if(fingerprintUnlock && _fingerprint.IsAvailable)
{
if(Device.OS == TargetPlatform.iOS)
if(Current.MainPage.Navigation.ModalStack.LastOrDefault() as LockFingerprintPage == null)
{
if(Current.MainPage.Navigation.ModalStack.LastOrDefault() as LockFingerprintPage == null)
{
await Current.MainPage.Navigation.PushModalAsync(new LockFingerprintPage(!forceLock), false);
}
await Current.MainPage.Navigation.PushModalAsync(new LockFingerprintPage(!forceLock), false);
}
}
else if(pinUnlock)