summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am/service/global_state_controller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/am/service/global_state_controller.cpp')
-rw-r--r--src/core/hle/service/am/service/global_state_controller.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/core/hle/service/am/service/global_state_controller.cpp b/src/core/hle/service/am/service/global_state_controller.cpp
new file mode 100644
index 000000000..dba5d3613
--- /dev/null
+++ b/src/core/hle/service/am/service/global_state_controller.cpp
@@ -0,0 +1,61 @@
+// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "core/hle/service/am/service/cradle_firmware_updater.h"
+#include "core/hle/service/am/service/global_state_controller.h"
+#include "core/hle/service/cmif_serialization.h"
+
+namespace Service::AM {
+
+IGlobalStateController::IGlobalStateController(Core::System& system_)
+ : ServiceFramework{system_, "IGlobalStateController"},
+ m_context{system_, "IGlobalStateController"}, m_hdcp_authentication_failed_event{m_context} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "RequestToEnterSleep"},
+ {1, nullptr, "EnterSleep"},
+ {2, nullptr, "StartSleepSequence"},
+ {3, nullptr, "StartShutdownSequence"},
+ {4, nullptr, "StartRebootSequence"},
+ {9, nullptr, "IsAutoPowerDownRequested"},
+ {10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"},
+ {11, nullptr, "NotifyCecSettingsChanged"},
+ {12, nullptr, "SetDefaultHomeButtonLongPressTime"},
+ {13, nullptr, "UpdateDefaultDisplayResolution"},
+ {14, D<&IGlobalStateController::ShouldSleepOnBoot>, "ShouldSleepOnBoot"},
+ {15, D<&IGlobalStateController::GetHdcpAuthenticationFailedEvent>, "GetHdcpAuthenticationFailedEvent"},
+ {30, D<&IGlobalStateController::OpenCradleFirmwareUpdater>, "OpenCradleFirmwareUpdater"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+}
+
+IGlobalStateController::~IGlobalStateController() = default;
+
+Result IGlobalStateController::LoadAndApplyIdlePolicySettings() {
+ LOG_WARNING(Service_AM, "(STUBBED) called");
+ R_SUCCEED();
+}
+
+Result IGlobalStateController::ShouldSleepOnBoot(Out<bool> out_should_sleep_on_boot) {
+ LOG_INFO(Service_AM, "called");
+ *out_should_sleep_on_boot = false;
+ R_SUCCEED();
+}
+
+Result IGlobalStateController::GetHdcpAuthenticationFailedEvent(
+ OutCopyHandle<Kernel::KReadableEvent> out_event) {
+ LOG_INFO(Service_AM, "called");
+ *out_event = m_hdcp_authentication_failed_event.GetHandle();
+ R_SUCCEED();
+}
+
+Result IGlobalStateController::OpenCradleFirmwareUpdater(
+ Out<SharedPointer<ICradleFirmwareUpdater>> out_cradle_firmware_updater) {
+ LOG_INFO(Service_AM, "called");
+ *out_cradle_firmware_updater = std::make_shared<ICradleFirmwareUpdater>(system);
+ R_SUCCEED();
+}
+
+} // namespace Service::AM