Commit 6f01e2f0 by bachinger Committed by Christos Tsilopoulos

Make constructor of PlayerNotificationManager protected

Issue: #9303
#minor-release
PiperOrigin-RevId: 392022613
parent 54418eb6
...@@ -307,25 +307,25 @@ public class PlayerNotificationManager { ...@@ -307,25 +307,25 @@ public class PlayerNotificationManager {
/** A builder for {@link PlayerNotificationManager} instances. */ /** A builder for {@link PlayerNotificationManager} instances. */
public static class Builder { public static class Builder {
private final Context context; protected final Context context;
private final int notificationId; protected final int notificationId;
private final String channelId; protected final String channelId;
@Nullable private NotificationListener notificationListener; @Nullable protected NotificationListener notificationListener;
@Nullable private CustomActionReceiver customActionReceiver; @Nullable protected CustomActionReceiver customActionReceiver;
private MediaDescriptionAdapter mediaDescriptionAdapter; protected MediaDescriptionAdapter mediaDescriptionAdapter;
private int channelNameResourceId; protected int channelNameResourceId;
private int channelDescriptionResourceId; protected int channelDescriptionResourceId;
private int channelImportance; protected int channelImportance;
private int smallIconResourceId; protected int smallIconResourceId;
private int rewindActionIconResourceId; protected int rewindActionIconResourceId;
private int playActionIconResourceId; protected int playActionIconResourceId;
private int pauseActionIconResourceId; protected int pauseActionIconResourceId;
private int stopActionIconResourceId; protected int stopActionIconResourceId;
private int fastForwardActionIconResourceId; protected int fastForwardActionIconResourceId;
private int previousActionIconResourceId; protected int previousActionIconResourceId;
private int nextActionIconResourceId; protected int nextActionIconResourceId;
@Nullable private String groupKey; @Nullable protected String groupKey;
/** /**
* @deprecated Use {@link #Builder(Context, int, String)} instead, then call {@link * @deprecated Use {@link #Builder(Context, int, String)} instead, then call {@link
...@@ -707,7 +707,7 @@ public class PlayerNotificationManager { ...@@ -707,7 +707,7 @@ public class PlayerNotificationManager {
private boolean useChronometer; private boolean useChronometer;
@Nullable private String groupKey; @Nullable private String groupKey;
private PlayerNotificationManager( protected PlayerNotificationManager(
Context context, Context context,
String channelId, String channelId,
int notificationId, int notificationId,
...@@ -836,7 +836,7 @@ public class PlayerNotificationManager { ...@@ -836,7 +836,7 @@ public class PlayerNotificationManager {
* *
* @param useNextAction Whether to use the next action. * @param useNextAction Whether to use the next action.
*/ */
public void setUseNextAction(boolean useNextAction) { public final void setUseNextAction(boolean useNextAction) {
if (this.useNextAction != useNextAction) { if (this.useNextAction != useNextAction) {
this.useNextAction = useNextAction; this.useNextAction = useNextAction;
invalidate(); invalidate();
...@@ -848,7 +848,7 @@ public class PlayerNotificationManager { ...@@ -848,7 +848,7 @@ public class PlayerNotificationManager {
* *
* @param usePreviousAction Whether to use the previous action. * @param usePreviousAction Whether to use the previous action.
*/ */
public void setUsePreviousAction(boolean usePreviousAction) { public final void setUsePreviousAction(boolean usePreviousAction) {
if (this.usePreviousAction != usePreviousAction) { if (this.usePreviousAction != usePreviousAction) {
this.usePreviousAction = usePreviousAction; this.usePreviousAction = usePreviousAction;
invalidate(); invalidate();
...@@ -865,7 +865,7 @@ public class PlayerNotificationManager { ...@@ -865,7 +865,7 @@ public class PlayerNotificationManager {
* *
* @param useNextActionInCompactView Whether to use the next action in compact view. * @param useNextActionInCompactView Whether to use the next action in compact view.
*/ */
public void setUseNextActionInCompactView(boolean useNextActionInCompactView) { public final void setUseNextActionInCompactView(boolean useNextActionInCompactView) {
if (this.useNextActionInCompactView != useNextActionInCompactView) { if (this.useNextActionInCompactView != useNextActionInCompactView) {
this.useNextActionInCompactView = useNextActionInCompactView; this.useNextActionInCompactView = useNextActionInCompactView;
if (useNextActionInCompactView) { if (useNextActionInCompactView) {
...@@ -885,7 +885,7 @@ public class PlayerNotificationManager { ...@@ -885,7 +885,7 @@ public class PlayerNotificationManager {
* *
* @param usePreviousActionInCompactView Whether to use the previous action in compact view. * @param usePreviousActionInCompactView Whether to use the previous action in compact view.
*/ */
public void setUsePreviousActionInCompactView(boolean usePreviousActionInCompactView) { public final void setUsePreviousActionInCompactView(boolean usePreviousActionInCompactView) {
if (this.usePreviousActionInCompactView != usePreviousActionInCompactView) { if (this.usePreviousActionInCompactView != usePreviousActionInCompactView) {
this.usePreviousActionInCompactView = usePreviousActionInCompactView; this.usePreviousActionInCompactView = usePreviousActionInCompactView;
if (usePreviousActionInCompactView) { if (usePreviousActionInCompactView) {
...@@ -900,7 +900,7 @@ public class PlayerNotificationManager { ...@@ -900,7 +900,7 @@ public class PlayerNotificationManager {
* *
* @param useFastForwardAction Whether to use the fast forward action. * @param useFastForwardAction Whether to use the fast forward action.
*/ */
public void setUseFastForwardAction(boolean useFastForwardAction) { public final void setUseFastForwardAction(boolean useFastForwardAction) {
if (this.useFastForwardAction != useFastForwardAction) { if (this.useFastForwardAction != useFastForwardAction) {
this.useFastForwardAction = useFastForwardAction; this.useFastForwardAction = useFastForwardAction;
invalidate(); invalidate();
...@@ -912,7 +912,7 @@ public class PlayerNotificationManager { ...@@ -912,7 +912,7 @@ public class PlayerNotificationManager {
* *
* @param useRewindAction Whether to use the rewind action. * @param useRewindAction Whether to use the rewind action.
*/ */
public void setUseRewindAction(boolean useRewindAction) { public final void setUseRewindAction(boolean useRewindAction) {
if (this.useRewindAction != useRewindAction) { if (this.useRewindAction != useRewindAction) {
this.useRewindAction = useRewindAction; this.useRewindAction = useRewindAction;
invalidate(); invalidate();
...@@ -929,7 +929,8 @@ public class PlayerNotificationManager { ...@@ -929,7 +929,8 @@ public class PlayerNotificationManager {
* @param useFastForwardActionInCompactView Whether to use the fast forward action in compact * @param useFastForwardActionInCompactView Whether to use the fast forward action in compact
* view. * view.
*/ */
public void setUseFastForwardActionInCompactView(boolean useFastForwardActionInCompactView) { public final void setUseFastForwardActionInCompactView(
boolean useFastForwardActionInCompactView) {
if (this.useFastForwardActionInCompactView != useFastForwardActionInCompactView) { if (this.useFastForwardActionInCompactView != useFastForwardActionInCompactView) {
this.useFastForwardActionInCompactView = useFastForwardActionInCompactView; this.useFastForwardActionInCompactView = useFastForwardActionInCompactView;
if (useFastForwardActionInCompactView) { if (useFastForwardActionInCompactView) {
...@@ -948,7 +949,7 @@ public class PlayerNotificationManager { ...@@ -948,7 +949,7 @@ public class PlayerNotificationManager {
* *
* @param useRewindActionInCompactView Whether to use the rewind action in compact view. * @param useRewindActionInCompactView Whether to use the rewind action in compact view.
*/ */
public void setUseRewindActionInCompactView(boolean useRewindActionInCompactView) { public final void setUseRewindActionInCompactView(boolean useRewindActionInCompactView) {
if (this.useRewindActionInCompactView != useRewindActionInCompactView) { if (this.useRewindActionInCompactView != useRewindActionInCompactView) {
this.useRewindActionInCompactView = useRewindActionInCompactView; this.useRewindActionInCompactView = useRewindActionInCompactView;
if (useRewindActionInCompactView) { if (useRewindActionInCompactView) {
...@@ -1159,7 +1160,7 @@ public class PlayerNotificationManager { ...@@ -1159,7 +1160,7 @@ public class PlayerNotificationManager {
} }
/** Forces an update of the notification if already started. */ /** Forces an update of the notification if already started. */
public void invalidate() { public final void invalidate() {
if (isNotificationStarted) { if (isNotificationStarted) {
postStartOrUpdateNotification(); postStartOrUpdateNotification();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment