Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1b1a1a64
authored
Nov 24, 2020
by
andrewlewis
Committed by
kim-vde
Nov 24, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Mark pending TODOs for media2 1.1.0 consistently
#exofixit PiperOrigin-RevId: 344031062
parent
866c7f85
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/MediaSessionUtil.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/SessionCallback.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnector.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/MediaSessionUtil.java
View file @
1b1a1a64
...
...
@@ -23,7 +23,7 @@ import androidx.media2.session.MediaSession;
public
final
class
MediaSessionUtil
{
/** 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
)
{
@SuppressLint
(
"RestrictedApi"
)
@SuppressWarnings
(
"RestrictTo"
)
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/SessionCallback.java
View file @
1b1a1a64
...
...
@@ -227,7 +227,7 @@ import java.util.concurrent.TimeoutException;
}
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
)
{
build
.
removeCommand
(
new
SessionCommand
(
SessionCommand
.
COMMAND_CODE_PLAYER_SET_MEDIA_ITEM
));
build
.
removeCommand
(
new
SessionCommand
(
SessionCommand
.
COMMAND_CODE_PLAYER_SET_PLAYLIST
));
...
...
@@ -348,6 +348,8 @@ import java.util.concurrent.TimeoutException;
updateAllowedCommands
();
}
// TODO(internal b/160846312): Remove warning suppression and mark item @Nullable once we depend
// on media2 1.2.0.
@Override
@SuppressWarnings
(
"nullness:override.param.invalid"
)
public
void
onCurrentMediaItemChanged
(
SessionPlayer
player
,
MediaItem
item
)
{
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnector.java
View file @
1b1a1a64
...
...
@@ -437,9 +437,9 @@ public final class SessionPlayerConnector extends SessionPlayer {
/* defaultValueWhenException= */
END_OF_PLAYLIST
);
}
// TODO(b/147706139): Call super.close() after updating media2-common to 1.1.0
@SuppressWarnings
(
"MissingSuperCall"
)
// TODO(internal b/160846312): Call super.close() once we depend on media2 1.1.0.
@Override
@SuppressWarnings
(
"MissingSuperCall"
)
public
void
close
()
{
synchronized
(
stateLock
)
{
if
(
closed
)
{
...
...
@@ -559,8 +559,8 @@ public final class SessionPlayerConnector extends SessionPlayer {
}
}
// TODO
: Remove this suppress warnings and call onCurrentMediaItemChanged with a null item
//
once AndroidX media2 1.2.0 is released
// TODO
(internal b/160846312): Remove this suppress warnings and call onCurrentMediaItemChanged
//
with a null item once we depend on media2 1.2.0.
@SuppressWarnings
(
"nullness:argument.type.incompatible"
)
private
void
handlePlaylistChangedOnHandler
()
{
List
<
MediaItem
>
currentPlaylist
=
player
.
getPlaylist
();
...
...
@@ -581,7 +581,7 @@ public final class SessionPlayerConnector extends SessionPlayer {
// Workaround for MediaSession's issue that current media item change isn't propagated
// 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
);
}
});
...
...
@@ -600,7 +600,7 @@ public final class SessionPlayerConnector extends SessionPlayer {
// Workaround for MediaSession's issue that current media item change isn't propagated
// 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
);
});
}
...
...
@@ -725,7 +725,7 @@ public final class SessionPlayerConnector extends SessionPlayer {
// Workaround for MediaSession's issue that current media item change isn't propagated
// 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
);
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment