implementing MediaSession using MPRIS

NotificationManager will now ignore MediaStyle notifications
This commit is contained in:
Julian Winkler
2024-07-15 16:39:45 +02:00
parent eddd827e27
commit b54bed4784
9 changed files with 272 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
package android.app;
import android.app.Notification.MediaStyle;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -10,6 +11,10 @@ public class NotificationManager {
public void cancelAll() {}
public void notify(String tag, int id, Notification notification) {
if (notification.style instanceof MediaStyle) {
return; // MPRIS is handled by MediaSession implementation
}
System.out.println("notify(" + tag + ", " + id + ", " + notification + ") called");
long builder = nativeInitBuilder();
for (Notification.Action action : notification.actions) {