mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-01 22: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:
@@ -139,6 +139,10 @@ public class MprisActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
targetPlayer = mpris.getPlayerStatus(player);
|
targetPlayer = mpris.getPlayerStatus(player);
|
||||||
updatePlayerStatus(mpris);
|
updatePlayerStatus(mpris);
|
||||||
|
|
||||||
|
if (targetPlayer.isPlaying()) {
|
||||||
|
MprisMediaSession.getInstance().playerSelected(targetPlayer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -405,4 +405,9 @@ public class MprisMediaSession implements SharedPreferences.OnSharedPreferenceCh
|
|||||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||||
updateMediaNotification();
|
updateMediaNotification();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void playerSelected(MprisPlugin.MprisPlayer player) {
|
||||||
|
notificationPlayer = player;
|
||||||
|
updateMediaNotification();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user