You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
implementing MediaSession using MPRIS
NotificationManager will now ignore MediaStyle notifications
This commit is contained in:
@@ -54,6 +54,7 @@ public class Notification implements Parcelable {
|
||||
PendingIntent intent;
|
||||
String iconPath;
|
||||
boolean ongoing;
|
||||
Style style;
|
||||
|
||||
public String toString() {
|
||||
return "Notification [" + title + ", " + text + ", " + actions + "]";
|
||||
@@ -151,6 +152,7 @@ public class Notification implements Parcelable {
|
||||
}
|
||||
|
||||
public Builder setStyle(Style style) {
|
||||
notification.style = style;
|
||||
if (style instanceof MediaStyle) {
|
||||
notification.ongoing = true;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user