Add @CanIgnoreReturnValue to MediaSession.BuilderBase

PiperOrigin-RevId: 679536456
This commit is contained in:
bachinger 2024-09-27 04:30:32 -07:00 committed by Copybara-Service
parent e0e9f5b057
commit c6434a8276

View File

@ -2122,6 +2122,7 @@ public class MediaSession {
commandButtonsForMediaItems = ImmutableList.of(); commandButtonsForMediaItems = ImmutableList.of();
} }
@CanIgnoreReturnValue
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public BuilderT setSessionActivity(PendingIntent pendingIntent) { public BuilderT setSessionActivity(PendingIntent pendingIntent) {
if (Util.SDK_INT >= 31) { if (Util.SDK_INT >= 31) {
@ -2131,42 +2132,49 @@ public class MediaSession {
return (BuilderT) this; return (BuilderT) this;
} }
@CanIgnoreReturnValue
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public BuilderT setId(String id) { public BuilderT setId(String id) {
this.id = checkNotNull(id); this.id = checkNotNull(id);
return (BuilderT) this; return (BuilderT) this;
} }
@CanIgnoreReturnValue
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
/* package */ BuilderT setCallback(CallbackT callback) { /* package */ BuilderT setCallback(CallbackT callback) {
this.callback = checkNotNull(callback); this.callback = checkNotNull(callback);
return (BuilderT) this; return (BuilderT) this;
} }
@CanIgnoreReturnValue
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public BuilderT setExtras(Bundle tokenExtras) { public BuilderT setExtras(Bundle tokenExtras) {
this.tokenExtras = new Bundle(checkNotNull(tokenExtras)); this.tokenExtras = new Bundle(checkNotNull(tokenExtras));
return (BuilderT) this; return (BuilderT) this;
} }
@CanIgnoreReturnValue
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public BuilderT setSessionExtras(Bundle sessionExtras) { public BuilderT setSessionExtras(Bundle sessionExtras) {
this.sessionExtras = new Bundle(checkNotNull(sessionExtras)); this.sessionExtras = new Bundle(checkNotNull(sessionExtras));
return (BuilderT) this; return (BuilderT) this;
} }
@CanIgnoreReturnValue
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public BuilderT setBitmapLoader(BitmapLoader bitmapLoader) { public BuilderT setBitmapLoader(BitmapLoader bitmapLoader) {
this.bitmapLoader = checkNotNull(bitmapLoader); this.bitmapLoader = checkNotNull(bitmapLoader);
return (BuilderT) this; return (BuilderT) this;
} }
@CanIgnoreReturnValue
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public BuilderT setCustomLayout(List<CommandButton> customLayout) { public BuilderT setCustomLayout(List<CommandButton> customLayout) {
this.customLayout = ImmutableList.copyOf(customLayout); this.customLayout = ImmutableList.copyOf(customLayout);
return (BuilderT) this; return (BuilderT) this;
} }
@CanIgnoreReturnValue
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public BuilderT setShowPlayButtonIfPlaybackIsSuppressed( public BuilderT setShowPlayButtonIfPlaybackIsSuppressed(
boolean showPlayButtonIfPlaybackIsSuppressed) { boolean showPlayButtonIfPlaybackIsSuppressed) {
@ -2174,12 +2182,14 @@ public class MediaSession {
return (BuilderT) this; return (BuilderT) this;
} }
@CanIgnoreReturnValue
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public BuilderT setCommandButtonsForMediaItems(List<CommandButton> commandButtons) { public BuilderT setCommandButtonsForMediaItems(List<CommandButton> commandButtons) {
this.commandButtonsForMediaItems = ImmutableList.copyOf(commandButtons); this.commandButtonsForMediaItems = ImmutableList.copyOf(commandButtons);
return (BuilderT) this; return (BuilderT) this;
} }
@CanIgnoreReturnValue
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public BuilderT setPeriodicPositionUpdateEnabled(boolean isPeriodicPositionUpdateEnabled) { public BuilderT setPeriodicPositionUpdateEnabled(boolean isPeriodicPositionUpdateEnabled) {
this.isPeriodicPositionUpdateEnabled = isPeriodicPositionUpdateEnabled; this.isPeriodicPositionUpdateEnabled = isPeriodicPositionUpdateEnabled;