Skip to content

Commit

Permalink
Never auto-hibernate if standby and autopoweroff are turned off
Browse files Browse the repository at this point in the history
  • Loading branch information
lvs1974 committed Apr 22, 2020
1 parent d3411ec commit a83578a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion HibernationFixup/kern_hbfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@ IOReturn HBFX::X86PlatformPlugin_sleepPolicyHandler(void * target, IOPMSystemSle
callbackHBFX->sleepFlags = params->sleepFlags;
}

bool standbyEnabled = (OSDynamicCast(OSBoolean, IOService::getPMRootDomain()->getProperty(kIOPMDeepSleepEnabledKey)) == kOSBooleanTrue ||
OSDynamicCast(OSBoolean, IOService::getPMRootDomain()->getProperty(kIOPMAutoPowerOffEnabledKey)) == kOSBooleanTrue);
auto autoHibernateMode = ADDPR(hbfx_config).autoHibernateMode;
while ((autoHibernateMode & Configuration::EnableAutoHibernation) &&
while (standbyEnabled && (autoHibernateMode & Configuration::EnableAutoHibernation) &&
(params->sleepType == kIOPMSleepTypeDeepIdle || params->sleepType == kIOPMSleepTypeStandby))
{
IOPMPowerSource *power_source = callbackHBFX->getPowerSource();
Expand Down

0 comments on commit a83578a

Please sign in to comment.