summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am/am.cpp32
-rw-r--r--src/core/hle/service/am/am.h3
2 files changed, 33 insertions, 2 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 9fdcf2965..a192a1f5f 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -266,8 +266,8 @@ 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, &ISelfController::IsAutoSleepDisabled, "IsAutoSleepDisabled"},
271 {70, nullptr, "ReportMultimediaError"}, 271 {70, nullptr, "ReportMultimediaError"},
272 {71, nullptr, "GetCurrentIlluminanceEx"}, 272 {71, nullptr, "GetCurrentIlluminanceEx"},
273 {80, nullptr, "SetWirelessPriorityMode"}, 273 {80, nullptr, "SetWirelessPriorityMode"},
@@ -454,6 +454,34 @@ 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
457void 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
477void ISelfController::IsAutoSleepDisabled(Kernel::HLERequestContext& ctx) {
478 LOG_DEBUG(Service_AM, "called.");
479
480 IPC::ResponseBuilder rb{ctx, 3};
481 rb.Push(RESULT_SUCCESS);
482 rb.Push(is_auto_sleep_disabled);
483}
484
457void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx) { 485void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx) {
458 LOG_DEBUG(Service_AM, "called."); 486 LOG_DEBUG(Service_AM, "called.");
459 487
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 14b010164..6cb582483 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -133,6 +133,8 @@ 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);
137 void IsAutoSleepDisabled(Kernel::HLERequestContext& ctx);
136 void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx); 138 void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx);
137 void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx); 139 void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx);
138 140
@@ -142,6 +144,7 @@ private:
142 144
143 u32 idle_time_detection_extension = 0; 145 u32 idle_time_detection_extension = 0;
144 u64 num_fatal_sections_entered = 0; 146 u64 num_fatal_sections_entered = 0;
147 bool is_auto_sleep_disabled = false;
145}; 148};
146 149
147class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { 150class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {