Wait 5s before enforcing inhibition

Review Request #126145 - Created Nov. 23, 2015 and submitted

Kai Uwe Broulik

Whenever Chrome plays sound it posts an inhibition. This is great, except that it does that also when playing a short sound, such as when receiving a message. This patch makes PowerDevil wait 5 seconds before actually enforcing the inhibition. In any case I don't want to have the system wake up for any such sort inhibitions.

Also cleanup, the add inhibition and add inhibition with explicit dbus service methods were virtually identical.

Started a video, stopped it right away. -> No inhibition shown in battery monitor
Started a video, waited longer -> Inhibition appeared
stopped video again -> inhibition disappeared right away
Started playback in VLC while Chrome was playing -> got two inhibitions shortly thereafter
Closed VLC -> Only Chrome's inhibition left

Asked for someone to send me a message, received it -> No inhibition was enforced because the sound was too short

Kai Uwe Broulik
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit eca79138c15575f6f523a8680919b407f84da2e2 by Kai Uwe Broulik to branch master.
Martin Klapetek

...why not stable branch?

  1. I fear it might break things, it's also a behavioral change, though I've been running it for weeks without a problem.
    I can merge it to 5.5 once 5.5.1 is tagged.

  2. Ah, fair enough. I was just wondering :)