diff --git a/app/src/main/cpp/skyline/services/am/controller/ISelfController.cpp b/app/src/main/cpp/skyline/services/am/controller/ISelfController.cpp index 4f0389f9..467a905b 100644 --- a/app/src/main/cpp/skyline/services/am/controller/ISelfController.cpp +++ b/app/src/main/cpp/skyline/services/am/controller/ISelfController.cpp @@ -71,11 +71,16 @@ namespace skyline::service::am { } Result ISelfController::SetIdleTimeDetectionExtension(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { - auto idleTimeDetectionExtension{request.Pop()}; + idleTimeDetectionExtension = request.Pop(); Logger::Debug("Setting Idle Time Detection Extension: 0x{:X}", idleTimeDetectionExtension); return {}; } + Result ISelfController::GetIdleTimeDetectionExtension(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + response.Push(idleTimeDetectionExtension); + return {}; + } + Result ISelfController::GetAccumulatedSuspendedTickValue(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { // TODO: Properly handle this after we implement game suspending response.Push(0); diff --git a/app/src/main/cpp/skyline/services/am/controller/ISelfController.h b/app/src/main/cpp/skyline/services/am/controller/ISelfController.h index 22360f1c..f6f3e290 100644 --- a/app/src/main/cpp/skyline/services/am/controller/ISelfController.h +++ b/app/src/main/cpp/skyline/services/am/controller/ISelfController.h @@ -19,6 +19,7 @@ namespace skyline::service::am { std::shared_ptr libraryAppletLaunchableEvent; //!< This KEvent is triggered when the library applet is launchable std::shared_ptr accumulatedSuspendedTickChangedEvent; //!< This KEvent is triggered when the time the system has spent in suspend is updated std::shared_ptr hosbinder; //!< IHOSBinder service for managed display layers + u32 idleTimeDetectionExtension{0}; public: ISelfController(const DeviceState &state, ServiceManager &manager); @@ -98,6 +99,11 @@ namespace skyline::service::am { */ Result SetIdleTimeDetectionExtension(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** + * @url https://switchbrew.org/wiki/Applet_Manager_services#GetIdleTimeDetectionExtension + */ + Result GetIdleTimeDetectionExtension(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** * @brief Returns how long the process was suspended for in ticks * @url https://switchbrew.org/wiki/Applet_Manager_services#GetAccumulatedSuspendedTickValue @@ -129,6 +135,7 @@ namespace skyline::service::am { SFUNC(0x13, ISelfController, SetAlbumImageOrientation), SFUNC(0x28, ISelfController, CreateManagedDisplayLayer), SFUNC(0x3E, ISelfController, SetIdleTimeDetectionExtension), + SFUNC(0x3F, ISelfController, GetIdleTimeDetectionExtension), SFUNC(0x5A, ISelfController, GetAccumulatedSuspendedTickValue), SFUNC(0x5B, ISelfController, GetAccumulatedSuspendedTickChangedEvent), SFUNC(0x64, ISelfController, SetAlbumImageTakenNotificationEnabled)