mirror of
https://github.com/bitwarden/mobile
synced 2025-12-21 18:53:29 +00:00
Lock Screen Fixes
- Move settings to AppSettingsService - Update activity on page disappaearing - Always check if app is currently locked before updating last activity date
This commit is contained in:
41
src/App/Services/AppSettingsService.cs
Normal file
41
src/App/Services/AppSettingsService.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using Bit.App.Abstractions;
|
||||
using Plugin.Settings.Abstractions;
|
||||
|
||||
namespace Bit.App.Services
|
||||
{
|
||||
public class AppSettingsService : IAppSettingsService
|
||||
{
|
||||
private readonly ISettings _settings;
|
||||
|
||||
public AppSettingsService(
|
||||
ISettings settings)
|
||||
{
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
public bool Locked
|
||||
{
|
||||
get
|
||||
{
|
||||
return _settings.GetValueOrDefault(Constants.Locked, false);
|
||||
}
|
||||
set
|
||||
{
|
||||
_settings.AddOrUpdateValue(Constants.Locked, value);
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime LastActivity
|
||||
{
|
||||
get
|
||||
{
|
||||
return _settings.GetValueOrDefault(Constants.LastActivityDate, DateTime.MinValue);
|
||||
}
|
||||
set
|
||||
{
|
||||
_settings.AddOrUpdateValue(Constants.LastActivityDate, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user