Make constructor of PlayerNotificationManager protected

Issue: #9303
#minor-release
PiperOrigin-RevId: 392022613
This commit is contained in:
bachinger 2021-08-20 18:43:15 +01:00
parent 3f16730763
commit 2f09ecef53

View File

@ -308,25 +308,25 @@ public class PlayerNotificationManager {
/** A builder for {@link PlayerNotificationManager} instances. */
public static class Builder {
private final Context context;
private final int notificationId;
private final String channelId;
protected final Context context;
protected final int notificationId;
protected final String channelId;
@Nullable private NotificationListener notificationListener;
@Nullable private CustomActionReceiver customActionReceiver;
private MediaDescriptionAdapter mediaDescriptionAdapter;
private int channelNameResourceId;
private int channelDescriptionResourceId;
private int channelImportance;
private int smallIconResourceId;
private int rewindActionIconResourceId;
private int playActionIconResourceId;
private int pauseActionIconResourceId;
private int stopActionIconResourceId;
private int fastForwardActionIconResourceId;
private int previousActionIconResourceId;
private int nextActionIconResourceId;
@Nullable private String groupKey;
@Nullable protected NotificationListener notificationListener;
@Nullable protected CustomActionReceiver customActionReceiver;
protected MediaDescriptionAdapter mediaDescriptionAdapter;
protected int channelNameResourceId;
protected int channelDescriptionResourceId;
protected int channelImportance;
protected int smallIconResourceId;
protected int rewindActionIconResourceId;
protected int playActionIconResourceId;
protected int pauseActionIconResourceId;
protected int stopActionIconResourceId;
protected int fastForwardActionIconResourceId;
protected int previousActionIconResourceId;
protected int nextActionIconResourceId;
@Nullable protected String groupKey;
/**
* @deprecated Use {@link #Builder(Context, int, String)} instead, then call {@link
@ -708,7 +708,7 @@ public class PlayerNotificationManager {
private boolean useChronometer;
@Nullable private String groupKey;
private PlayerNotificationManager(
protected PlayerNotificationManager(
Context context,
String channelId,
int notificationId,
@ -837,7 +837,7 @@ public class PlayerNotificationManager {
*
* @param useNextAction Whether to use the next action.
*/
public void setUseNextAction(boolean useNextAction) {
public final void setUseNextAction(boolean useNextAction) {
if (this.useNextAction != useNextAction) {
this.useNextAction = useNextAction;
invalidate();
@ -849,7 +849,7 @@ public class PlayerNotificationManager {
*
* @param usePreviousAction Whether to use the previous action.
*/
public void setUsePreviousAction(boolean usePreviousAction) {
public final void setUsePreviousAction(boolean usePreviousAction) {
if (this.usePreviousAction != usePreviousAction) {
this.usePreviousAction = usePreviousAction;
invalidate();
@ -866,7 +866,7 @@ public class PlayerNotificationManager {
*
* @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) {
this.useNextActionInCompactView = useNextActionInCompactView;
if (useNextActionInCompactView) {
@ -886,7 +886,7 @@ public class PlayerNotificationManager {
*
* @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) {
this.usePreviousActionInCompactView = usePreviousActionInCompactView;
if (usePreviousActionInCompactView) {
@ -901,7 +901,7 @@ public class PlayerNotificationManager {
*
* @param useFastForwardAction Whether to use the fast forward action.
*/
public void setUseFastForwardAction(boolean useFastForwardAction) {
public final void setUseFastForwardAction(boolean useFastForwardAction) {
if (this.useFastForwardAction != useFastForwardAction) {
this.useFastForwardAction = useFastForwardAction;
invalidate();
@ -913,7 +913,7 @@ public class PlayerNotificationManager {
*
* @param useRewindAction Whether to use the rewind action.
*/
public void setUseRewindAction(boolean useRewindAction) {
public final void setUseRewindAction(boolean useRewindAction) {
if (this.useRewindAction != useRewindAction) {
this.useRewindAction = useRewindAction;
invalidate();
@ -930,7 +930,8 @@ public class PlayerNotificationManager {
* @param useFastForwardActionInCompactView Whether to use the fast forward action in compact
* view.
*/
public void setUseFastForwardActionInCompactView(boolean useFastForwardActionInCompactView) {
public final void setUseFastForwardActionInCompactView(
boolean useFastForwardActionInCompactView) {
if (this.useFastForwardActionInCompactView != useFastForwardActionInCompactView) {
this.useFastForwardActionInCompactView = useFastForwardActionInCompactView;
if (useFastForwardActionInCompactView) {
@ -949,7 +950,7 @@ public class PlayerNotificationManager {
*
* @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) {
this.useRewindActionInCompactView = useRewindActionInCompactView;
if (useRewindActionInCompactView) {
@ -1160,7 +1161,7 @@ public class PlayerNotificationManager {
}
/** Forces an update of the notification if already started. */
public void invalidate() {
public final void invalidate() {
if (isNotificationStarted) {
postStartOrUpdateNotification();
}