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
44ad4774
authored
Apr 29, 2019
by
bachinger
Committed by
Oliver Woodman
Apr 30, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Never set null as a session meta data object.
Issue: #5810 PiperOrigin-RevId: 245745646
parent
1fb128df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java
extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java
View file @
44ad4774
...
@@ -146,6 +146,9 @@ public final class MediaSessionConnector {
...
@@ -146,6 +146,9 @@ public final class MediaSessionConnector {
private
static
final
int
EDITOR_MEDIA_SESSION_FLAGS
=
private
static
final
int
EDITOR_MEDIA_SESSION_FLAGS
=
BASE_MEDIA_SESSION_FLAGS
|
MediaSessionCompat
.
FLAG_HANDLES_QUEUE_COMMANDS
;
BASE_MEDIA_SESSION_FLAGS
|
MediaSessionCompat
.
FLAG_HANDLES_QUEUE_COMMANDS
;
private
static
final
MediaMetadataCompat
METADATA_EMPTY
=
new
MediaMetadataCompat
.
Builder
().
build
();
/** Receiver of media commands sent by a media controller. */
/** Receiver of media commands sent by a media controller. */
public
interface
CommandReceiver
{
public
interface
CommandReceiver
{
/**
/**
...
@@ -639,8 +642,8 @@ public final class MediaSessionConnector {
...
@@ -639,8 +642,8 @@ public final class MediaSessionConnector {
MediaMetadataCompat
metadata
=
MediaMetadataCompat
metadata
=
mediaMetadataProvider
!=
null
&&
player
!=
null
mediaMetadataProvider
!=
null
&&
player
!=
null
?
mediaMetadataProvider
.
getMetadata
(
player
)
?
mediaMetadataProvider
.
getMetadata
(
player
)
:
null
;
:
METADATA_EMPTY
;
mediaSession
.
setMetadata
(
metadata
);
mediaSession
.
setMetadata
(
metadata
!=
null
?
metadata
:
METADATA_EMPTY
);
}
}
/**
/**
...
@@ -888,7 +891,7 @@ public final class MediaSessionConnector {
...
@@ -888,7 +891,7 @@ public final class MediaSessionConnector {
@Override
@Override
public
MediaMetadataCompat
getMetadata
(
Player
player
)
{
public
MediaMetadataCompat
getMetadata
(
Player
player
)
{
if
(
player
.
getCurrentTimeline
().
isEmpty
())
{
if
(
player
.
getCurrentTimeline
().
isEmpty
())
{
return
null
;
return
METADATA_EMPTY
;
}
}
MediaMetadataCompat
.
Builder
builder
=
new
MediaMetadataCompat
.
Builder
();
MediaMetadataCompat
.
Builder
builder
=
new
MediaMetadataCompat
.
Builder
();
if
(
player
.
isPlayingAd
())
{
if
(
player
.
isPlayingAd
())
{
...
...
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