From ea7290afabbd884af8e8f98b4deadc39040380ce Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 28 Dec 2017 16:48:40 -0500 Subject: [PATCH] CheckForLockInBackground removed --- src/App/Abstractions/Services/ILockService.cs | 1 - src/App/App.cs | 7 ++----- src/App/Services/LockService.cs | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/App/Abstractions/Services/ILockService.cs b/src/App/Abstractions/Services/ILockService.cs index dd4066305..08e8ba474 100644 --- a/src/App/Abstractions/Services/ILockService.cs +++ b/src/App/Abstractions/Services/ILockService.cs @@ -6,7 +6,6 @@ namespace Bit.App.Abstractions { public interface ILockService { - bool CheckForLockInBackground { get; set; } void UpdateLastActivity(); Task GetLockTypeAsync(bool forceLock); Task CheckLockAsync(bool forceLock); diff --git a/src/App/App.cs b/src/App/App.cs index 551133b31..a7add896b 100644 --- a/src/App/App.cs +++ b/src/App/App.cs @@ -80,9 +80,9 @@ namespace Bit.App if(Device.RuntimePlatform == Device.iOS) { - MessagingCenter.Subscribe(Current, "Resumed", async (sender, args) => + MessagingCenter.Subscribe(Current, "Resumed", async (sender, forceLock) => { - Device.BeginInvokeOnMainThread(async () => await _lockService.CheckLockAsync(args)); + Device.BeginInvokeOnMainThread(async () => await _lockService.CheckLockAsync(forceLock)); await Task.Run(() => FullSyncAsync()).ConfigureAwait(false); }); } @@ -93,7 +93,6 @@ namespace Bit.App protected async override void OnStart() { // Handle when your app starts - _lockService.CheckForLockInBackground = false; await _lockService.CheckLockAsync(false); if(string.IsNullOrWhiteSpace(_options.Uri)) @@ -116,7 +115,6 @@ namespace Bit.App protected override void OnSleep() { // Handle when your app sleeps - _lockService.CheckForLockInBackground = true; Debug.WriteLine("OnSleep"); SetMainPageFromAutofill(); @@ -130,7 +128,6 @@ namespace Bit.App protected async override void OnResume() { base.OnResume(); - _lockService.CheckForLockInBackground = false; // workaround for app compat bug // ref https://forums.xamarin.com/discussion/62414/app-resuming-results-in-crash-with-formsappcompatactivity diff --git a/src/App/Services/LockService.cs b/src/App/Services/LockService.cs index 1d2adde04..d295a62f9 100644 --- a/src/App/Services/LockService.cs +++ b/src/App/Services/LockService.cs @@ -31,7 +31,6 @@ namespace Bit.App.Services _fingerprint = fingerprint; } - public bool CheckForLockInBackground { get; set; } = true; public double CurrentLockTime { get; set; } public void UpdateLastActivity()