1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-23 03:33:59 +00:00

detect nfc enabled

This commit is contained in:
Kyle Spearrin
2017-06-28 08:27:06 -04:00
parent cf41b524b0
commit 45c5801538
3 changed files with 12 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
using Android.App;
using Android.Nfc;
using Android.OS;
using Android.Util;
using Bit.App.Abstractions;
namespace Bit.Android.Services
@@ -42,5 +42,14 @@ namespace Bit.Android.Services
return 1f;
}
}
public bool NfcEnabled
{
get
{
var manager = (NfcManager)Application.Context.GetSystemService("nfc");
var adapter = manager.DefaultAdapter;
return adapter != null && adapter.IsEnabled;
}
}
}
}