summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nfc/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/nfc/common')
-rw-r--r--src/core/hle/service/nfc/common/device_manager.cpp8
-rw-r--r--src/core/hle/service/nfc/common/device_manager.h5
2 files changed, 11 insertions, 2 deletions
diff --git a/src/core/hle/service/nfc/common/device_manager.cpp b/src/core/hle/service/nfc/common/device_manager.cpp
index 94a8243b5..2dd3e9f89 100644
--- a/src/core/hle/service/nfc/common/device_manager.cpp
+++ b/src/core/hle/service/nfc/common/device_manager.cpp
@@ -13,6 +13,7 @@
#include "core/hle/service/nfc/nfc_result.h"
#include "core/hle/service/psc/time/steady_clock.h"
#include "core/hle/service/service.h"
+#include "core/hle/service/set/system_settings_server.h"
#include "core/hle/service/sm/sm.h"
#include "hid_core/hid_types.h"
#include "hid_core/hid_util.h"
@@ -32,6 +33,9 @@ DeviceManager::DeviceManager(Core::System& system_, KernelHelpers::ServiceContex
}
is_initialized = false;
+
+ m_set_sys =
+ system.ServiceManager().GetService<Service::Set::ISystemSettingsServer>("set:sys", true);
}
DeviceManager ::~DeviceManager() {
@@ -774,8 +778,8 @@ Result DeviceManager::CheckDeviceState(std::shared_ptr<NfcDevice> device) const
}
Result DeviceManager::IsNfcEnabled() const {
- // TODO: This calls nn::settings::detail::GetNfcEnableFlag
- const bool is_enabled = true;
+ bool is_enabled{};
+ R_TRY(m_set_sys->GetNfcEnableFlag(&is_enabled));
if (!is_enabled) {
return ResultNfcDisabled;
}
diff --git a/src/core/hle/service/nfc/common/device_manager.h b/src/core/hle/service/nfc/common/device_manager.h
index c56a2fbda..6c0e6b255 100644
--- a/src/core/hle/service/nfc/common/device_manager.h
+++ b/src/core/hle/service/nfc/common/device_manager.h
@@ -15,6 +15,10 @@
#include "core/hle/service/service.h"
#include "hid_core/hid_types.h"
+namespace Service::Set {
+class ISystemSettingsServer;
+}
+
namespace Service::NFC {
class NfcDevice;
@@ -98,6 +102,7 @@ private:
Core::System& system;
KernelHelpers::ServiceContext service_context;
Kernel::KEvent* availability_change_event;
+ std::shared_ptr<Service::Set::ISystemSettingsServer> m_set_sys;
};
} // namespace Service::NFC