Commit 1b1a1a64 by andrewlewis Committed by kim-vde

Mark pending TODOs for media2 1.1.0 consistently

#exofixit

PiperOrigin-RevId: 344031062
parent 866c7f85
...@@ -23,7 +23,7 @@ import androidx.media2.session.MediaSession; ...@@ -23,7 +23,7 @@ import androidx.media2.session.MediaSession;
public final class MediaSessionUtil { public final class MediaSessionUtil {
/** Gets the {@link MediaSessionCompat.Token} from the {@link MediaSession}. */ /** Gets the {@link MediaSessionCompat.Token} from the {@link MediaSession}. */
// TODO(b/152764014): Deprecate this API when MediaSession#getSessionCompatToken() is released. // TODO(internal b/160846312): Remove lint/warning suppression once we depend on media2 1.1.0.
public static MediaSessionCompat.Token getSessionCompatToken(MediaSession mediaSession) { public static MediaSessionCompat.Token getSessionCompatToken(MediaSession mediaSession) {
@SuppressLint("RestrictedApi") @SuppressLint("RestrictedApi")
@SuppressWarnings("RestrictTo") @SuppressWarnings("RestrictTo")
......
...@@ -227,7 +227,7 @@ import java.util.concurrent.TimeoutException; ...@@ -227,7 +227,7 @@ import java.util.concurrent.TimeoutException;
} }
build.addAllPredefinedCommands(SessionCommand.COMMAND_VERSION_1); build.addAllPredefinedCommands(SessionCommand.COMMAND_VERSION_1);
// TODO: Use removeCommand(int) when it's added [Internal: b/142848015]. // TODO(internal b/142848015): Use removeCommand(int) when it's added.
if (mediaItemProvider == null) { if (mediaItemProvider == null) {
build.removeCommand(new SessionCommand(SessionCommand.COMMAND_CODE_PLAYER_SET_MEDIA_ITEM)); build.removeCommand(new SessionCommand(SessionCommand.COMMAND_CODE_PLAYER_SET_MEDIA_ITEM));
build.removeCommand(new SessionCommand(SessionCommand.COMMAND_CODE_PLAYER_SET_PLAYLIST)); build.removeCommand(new SessionCommand(SessionCommand.COMMAND_CODE_PLAYER_SET_PLAYLIST));
...@@ -348,6 +348,8 @@ import java.util.concurrent.TimeoutException; ...@@ -348,6 +348,8 @@ import java.util.concurrent.TimeoutException;
updateAllowedCommands(); updateAllowedCommands();
} }
// TODO(internal b/160846312): Remove warning suppression and mark item @Nullable once we depend
// on media2 1.2.0.
@Override @Override
@SuppressWarnings("nullness:override.param.invalid") @SuppressWarnings("nullness:override.param.invalid")
public void onCurrentMediaItemChanged(SessionPlayer player, MediaItem item) { public void onCurrentMediaItemChanged(SessionPlayer player, MediaItem item) {
......
...@@ -437,9 +437,9 @@ public final class SessionPlayerConnector extends SessionPlayer { ...@@ -437,9 +437,9 @@ public final class SessionPlayerConnector extends SessionPlayer {
/* defaultValueWhenException= */ END_OF_PLAYLIST); /* defaultValueWhenException= */ END_OF_PLAYLIST);
} }
// TODO(b/147706139): Call super.close() after updating media2-common to 1.1.0 // TODO(internal b/160846312): Call super.close() once we depend on media2 1.1.0.
@SuppressWarnings("MissingSuperCall")
@Override @Override
@SuppressWarnings("MissingSuperCall")
public void close() { public void close() {
synchronized (stateLock) { synchronized (stateLock) {
if (closed) { if (closed) {
...@@ -559,8 +559,8 @@ public final class SessionPlayerConnector extends SessionPlayer { ...@@ -559,8 +559,8 @@ public final class SessionPlayerConnector extends SessionPlayer {
} }
} }
// TODO: Remove this suppress warnings and call onCurrentMediaItemChanged with a null item // TODO(internal b/160846312): Remove this suppress warnings and call onCurrentMediaItemChanged
// once AndroidX media2 1.2.0 is released // with a null item once we depend on media2 1.2.0.
@SuppressWarnings("nullness:argument.type.incompatible") @SuppressWarnings("nullness:argument.type.incompatible")
private void handlePlaylistChangedOnHandler() { private void handlePlaylistChangedOnHandler() {
List<MediaItem> currentPlaylist = player.getPlaylist(); List<MediaItem> currentPlaylist = player.getPlaylist();
...@@ -581,7 +581,7 @@ public final class SessionPlayerConnector extends SessionPlayer { ...@@ -581,7 +581,7 @@ public final class SessionPlayerConnector extends SessionPlayer {
// Workaround for MediaSession's issue that current media item change isn't propagated // Workaround for MediaSession's issue that current media item change isn't propagated
// to the legacy controllers. // to the legacy controllers.
// TODO(b/160846312): Remove this workaround with media2 1.1.0-stable. // TODO(internal b/160846312): Remove workaround once we depend on media2 1.1.0.
callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition); callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition);
} }
}); });
...@@ -600,7 +600,7 @@ public final class SessionPlayerConnector extends SessionPlayer { ...@@ -600,7 +600,7 @@ public final class SessionPlayerConnector extends SessionPlayer {
// Workaround for MediaSession's issue that current media item change isn't propagated // Workaround for MediaSession's issue that current media item change isn't propagated
// to the legacy controllers. // to the legacy controllers.
// TODO(b/160846312): Remove this workaround with media2 1.1.0-stable. // TODO(internal b/160846312): Remove workaround once we depend on media2 1.1.0.
callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition); callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition);
}); });
} }
...@@ -725,7 +725,7 @@ public final class SessionPlayerConnector extends SessionPlayer { ...@@ -725,7 +725,7 @@ public final class SessionPlayerConnector extends SessionPlayer {
// Workaround for MediaSession's issue that current media item change isn't propagated // Workaround for MediaSession's issue that current media item change isn't propagated
// to the legacy controllers. // to the legacy controllers.
// TODO(b/160846312): Remove this workaround with media2 1.1.0-stable. // TODO(internal b/160846312): Remove workaround once we depend on media2 1.1.0.
callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition); callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition);
}); });
} }
......
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