From 005882e6cfcc59e51a8b8d974eef42b511141cdd Mon Sep 17 00:00:00 2001 From: christosts Date: Thu, 7 Apr 2022 16:36:23 +0100 Subject: [PATCH] Filter media notification actions The DefaultMediaNotificationProvider checks if a command is available before putting the respective action in the notification. PiperOrigin-RevId: 440114422 --- .../src/main/java/com/google/android/exoplayer2/Player.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/common/src/main/java/com/google/android/exoplayer2/Player.java b/library/common/src/main/java/com/google/android/exoplayer2/Player.java index e15c29a922..53b5f52b19 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/Player.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/Player.java @@ -521,6 +521,11 @@ public interface Player { return flags.contains(command); } + /** Returns whether the set of commands contains at least one of the given {@code commands}. */ + public boolean containsAny(@Command int... commands) { + return flags.containsAny(commands); + } + /** Returns the number of commands in this set. */ public int size() { return flags.size();