[mpris2 dataengine] Fix media key handling to match MediaPlayer2.Player

Authored by kossebau on Mar 3 2018, 1:51 PM.

Description

[mpris2 dataengine] Fix media key handling to match MediaPlayer2.Player

Summary:

  • first check CanControl property, as it overrules things
  • next check each action Can* property, to spare D-Bus call and app activation if false
  • support CanPause and only call PlayPause is possible, otherwise use Play

Test Plan:
Vlc can be controlled by keyboard media keys as before,
Gwenview patched to support MPRIS (with CanPause=false) can now be
controlled with the Play/Pause media key.

Reviewers: broulik

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D10991