diff --git a/src/Android/Services/DeviceInfoService.cs b/src/Android/Services/DeviceInfoService.cs index e206e22cf..5ac4d09b2 100644 --- a/src/Android/Services/DeviceInfoService.cs +++ b/src/Android/Services/DeviceInfoService.cs @@ -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; + } + } } } diff --git a/src/App/Abstractions/Services/IDeviceInfoService.cs b/src/App/Abstractions/Services/IDeviceInfoService.cs index 6c08cc187..4e87274b6 100644 --- a/src/App/Abstractions/Services/IDeviceInfoService.cs +++ b/src/App/Abstractions/Services/IDeviceInfoService.cs @@ -5,5 +5,6 @@ string Model { get; } int Version { get; } float Scale { get; } + bool NfcEnabled { get; } } } diff --git a/src/iOS.Core/Services/DeviceInfoService.cs b/src/iOS.Core/Services/DeviceInfoService.cs index 646bbd69e..60b0cafa4 100644 --- a/src/iOS.Core/Services/DeviceInfoService.cs +++ b/src/iOS.Core/Services/DeviceInfoService.cs @@ -22,5 +22,6 @@ namespace Bit.iOS.Core.Services } } public float Scale => (float)UIScreen.MainScreen.Scale; + public bool NfcEnabled => false; } }