Cache whether screen powersaving is inhibited

Review Request #109126 - Created Feb. 24, 2013 and submitted

Oliver Henshaw
Cache whether screen powersaving is inhibited

DPMSAction disables or enables DPMS (and sets timeouts) as appropriate
when inhibition policy changes. As setting DPMS timeouts resets the
timer this will delay the time at which DPMS activates. But this is only
necessary if the ChangeScreenSettings inhibition changed.

Chrome sets short-lived InterruptSession inhibitions while uploading
data. This has the effect of indefinitely delaying DPMS activation.

So cache the current screen inhibition state and only decide whether to
enable or disable DPMS if the new state is different.

BUG: 314250
Tested that inhibition is correctly cached and that inhibiting session power saving does not affect DPMS idle time. Tested that the DPMS action continues to react properly when screen inhibition changes. Tested unloading and loading powerdevil module with and without active inhibitions.
Lukáš Tinkl
Dario Freddi
Commit Hook
Oliver Henshaw
Review request changed

Status: Closed (submitted)