From 0045d20d2cba0e2470342f2b96a42bd8096267c1 Mon Sep 17 00:00:00 2001 From: bachinger Date: Fri, 28 Aug 2020 12:31:36 +0100 Subject: [PATCH] Document how to set the priority on API level above 25 Issue: #7820 PiperOrigin-RevId: 328917063 --- .../android/exoplayer2/ui/PlayerNotificationManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java index 06a5341499..e23c91cd16 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java @@ -16,6 +16,7 @@ package com.google.android.exoplayer2.ui; import android.app.Notification; +import android.app.NotificationChannel; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; @@ -877,6 +878,10 @@ public class PlayerNotificationManager { * *

See {@link NotificationCompat.Builder#setPriority(int)}. * + *

To set the priority for API levels above 25, you can create your own {@link + * NotificationChannel} with a given importance level and pass the id of the channel to the {@link + * #PlayerNotificationManager(Context, String, int, MediaDescriptionAdapter) constructor}. + * * @param priority The priority which can be one of {@link NotificationCompat#PRIORITY_DEFAULT}, * {@link NotificationCompat#PRIORITY_MAX}, {@link NotificationCompat#PRIORITY_HIGH}, {@link * NotificationCompat#PRIORITY_LOW} or {@link NotificationCompat#PRIORITY_MIN}. If not set