2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 21:55:10 +00:00

Show the same mpris player in the notification as in the app

Summary:
So switching (currently playing) players in the app will also switch the
notification.

Test Plan: Tested with two players playing at the same time, and switching between them.

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: #kde_connect

Differential Revision: https://phabricator.kde.org/D11647
This commit is contained in:
Matthijs Tijink
2018-03-24 17:03:13 +01:00
parent eb801fa535
commit b1c4b6e1e9
2 changed files with 9 additions and 0 deletions

View File

@@ -139,6 +139,10 @@ public class MprisActivity extends AppCompatActivity {
}
targetPlayer = mpris.getPlayerStatus(player);
updatePlayerStatus(mpris);
if (targetPlayer.isPlaying()) {
MprisMediaSession.getInstance().playerSelected(targetPlayer);
}
}
@Override

View File

@@ -405,4 +405,9 @@ public class MprisMediaSession implements SharedPreferences.OnSharedPreferenceCh
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
updateMediaNotification();
}
public void playerSelected(MprisPlugin.MprisPlayer player) {
notificationPlayer = player;
updateMediaNotification();
}
}