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