diff options
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 22 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 2 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 9fdcf2965..3f2f5c7db 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -266,7 +266,7 @@ ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger | |||
| 266 | {65, nullptr, "ReportUserIsActive"}, | 266 | {65, nullptr, "ReportUserIsActive"}, |
| 267 | {66, nullptr, "GetCurrentIlluminance"}, | 267 | {66, nullptr, "GetCurrentIlluminance"}, |
| 268 | {67, nullptr, "IsIlluminanceAvailable"}, | 268 | {67, nullptr, "IsIlluminanceAvailable"}, |
| 269 | {68, nullptr, "SetAutoSleepDisabled"}, | 269 | {68, &ISelfController::SetAutoSleepDisabled, "SetAutoSleepDisabled"}, |
| 270 | {69, nullptr, "IsAutoSleepDisabled"}, | 270 | {69, nullptr, "IsAutoSleepDisabled"}, |
| 271 | {70, nullptr, "ReportMultimediaError"}, | 271 | {70, nullptr, "ReportMultimediaError"}, |
| 272 | {71, nullptr, "GetCurrentIlluminanceEx"}, | 272 | {71, nullptr, "GetCurrentIlluminanceEx"}, |
| @@ -454,6 +454,26 @@ void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& c | |||
| 454 | rb.Push<u32>(idle_time_detection_extension); | 454 | rb.Push<u32>(idle_time_detection_extension); |
| 455 | } | 455 | } |
| 456 | 456 | ||
| 457 | void ISelfController::SetAutoSleepDisabled(Kernel::HLERequestContext& ctx) { | ||
| 458 | IPC::RequestParser rp{ctx}; | ||
| 459 | is_auto_sleep_disabled = rp.Pop<bool>(); | ||
| 460 | |||
| 461 | // On the system itself, if the previous state of is_auto_sleep_disabled | ||
| 462 | // differed from the current value passed in, it'd signify the internal | ||
| 463 | // window manager to update (and also increment some statistics like update counts) | ||
| 464 | // | ||
| 465 | // It'd also indicate this change to an idle handling context. | ||
| 466 | // | ||
| 467 | // However, given we're emulating this behavior, most of this can be ignored | ||
| 468 | // and it's sufficient to simply set the member variable for querying via | ||
| 469 | // IsAutoSleepDisabled(). | ||
| 470 | |||
| 471 | LOG_DEBUG(Service_AM, "called. is_auto_sleep_disabled={}", is_auto_sleep_disabled); | ||
| 472 | |||
| 473 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 474 | rb.Push(RESULT_SUCCESS); | ||
| 475 | } | ||
| 476 | |||
| 457 | void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx) { | 477 | void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx) { |
| 458 | LOG_DEBUG(Service_AM, "called."); | 478 | LOG_DEBUG(Service_AM, "called."); |
| 459 | 479 | ||
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 14b010164..0788e2dc0 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -133,6 +133,7 @@ private: | |||
| 133 | void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx); | 133 | void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx); |
| 134 | void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); | 134 | void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); |
| 135 | void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); | 135 | void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); |
| 136 | void SetAutoSleepDisabled(Kernel::HLERequestContext& ctx); | ||
| 136 | void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx); | 137 | void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx); |
| 137 | void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx); | 138 | void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx); |
| 138 | 139 | ||
| @@ -142,6 +143,7 @@ private: | |||
| 142 | 143 | ||
| 143 | u32 idle_time_detection_extension = 0; | 144 | u32 idle_time_detection_extension = 0; |
| 144 | u64 num_fatal_sections_entered = 0; | 145 | u64 num_fatal_sections_entered = 0; |
| 146 | bool is_auto_sleep_disabled = false; | ||
| 145 | }; | 147 | }; |
| 146 | 148 | ||
| 147 | class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { | 149 | class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { |