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
87623220
authored
Aug 02, 2022
by
olly
Committed by
tonihei
Aug 02, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Update Leanback library
parent
4d09ca66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
libraries/ui_leanback/src/main/java/androidx/media3/ui/leanback/LeanbackPlayerAdapter.java
libraries/ui_leanback/src/main/java/androidx/media3/ui/leanback/LeanbackPlayerAdapter.java
View file @
87623220
...
@@ -95,6 +95,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
...
@@ -95,6 +95,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
player
.
addListener
(
playerListener
);
player
.
addListener
(
playerListener
);
}
}
// dereference of possibly-null reference callback
@SuppressWarnings
(
"nullness:dereference.of.nullable"
)
@Override
@Override
public
void
onDetachedFromHost
()
{
public
void
onDetachedFromHost
()
{
player
.
removeListener
(
playerListener
);
player
.
removeListener
(
playerListener
);
...
@@ -136,6 +138,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
...
@@ -136,6 +138,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
return
player
.
getPlaybackState
()
==
Player
.
STATE_IDLE
?
-
1
:
player
.
getCurrentPosition
();
return
player
.
getPlaybackState
()
==
Player
.
STATE_IDLE
?
-
1
:
player
.
getCurrentPosition
();
}
}
// dereference of possibly-null reference getCallback()
@SuppressWarnings
(
"nullness:dereference.of.nullable"
)
@Override
@Override
public
void
play
()
{
public
void
play
()
{
if
(
player
.
getPlaybackState
()
==
Player
.
STATE_IDLE
)
{
if
(
player
.
getPlaybackState
()
==
Player
.
STATE_IDLE
)
{
...
@@ -149,6 +153,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
...
@@ -149,6 +153,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
}
}
}
}
// dereference of possibly-null reference getCallback()
@SuppressWarnings
(
"nullness:dereference.of.nullable"
)
@Override
@Override
public
void
pause
()
{
public
void
pause
()
{
if
(
player
.
isCommandAvailable
(
Player
.
COMMAND_PLAY_PAUSE
))
{
if
(
player
.
isCommandAvailable
(
Player
.
COMMAND_PLAY_PAUSE
))
{
...
@@ -175,6 +181,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
...
@@ -175,6 +181,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
// Runnable implementation.
// Runnable implementation.
// dereference of possibly-null reference callback
@SuppressWarnings
(
"nullness:dereference.of.nullable"
)
@Override
@Override
public
void
run
()
{
public
void
run
()
{
Callback
callback
=
getCallback
();
Callback
callback
=
getCallback
();
...
@@ -185,13 +193,19 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
...
@@ -185,13 +193,19 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
// Internal methods.
// Internal methods.
/* package */
void
setVideoSurface
(
@Nullable
Surface
surface
)
{
/* package */
// incompatible argument for parameter callback of maybeNotifyPreparedStateChanged.
@SuppressWarnings
(
"nullness:argument.type.incompatible"
)
void
setVideoSurface
(
@Nullable
Surface
surface
)
{
hasSurface
=
surface
!=
null
;
hasSurface
=
surface
!=
null
;
player
.
setVideoSurface
(
surface
);
player
.
setVideoSurface
(
surface
);
maybeNotifyPreparedStateChanged
(
getCallback
());
maybeNotifyPreparedStateChanged
(
getCallback
());
}
}
/* package */
void
notifyStateChanged
()
{
/* package */
// incompatible argument for parameter callback of maybeNotifyPreparedStateChanged.
@SuppressWarnings
(
"nullness:argument.type.incompatible"
)
void
notifyStateChanged
()
{
int
playbackState
=
player
.
getPlaybackState
();
int
playbackState
=
player
.
getPlaybackState
();
Callback
callback
=
getCallback
();
Callback
callback
=
getCallback
();
maybeNotifyPreparedStateChanged
(
callback
);
maybeNotifyPreparedStateChanged
(
callback
);
...
@@ -236,6 +250,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
...
@@ -236,6 +250,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
// Player.Listener implementation.
// Player.Listener implementation.
// dereference of possibly-null reference callback
@SuppressWarnings
(
"nullness:dereference.of.nullable"
)
@Override
@Override
public
void
onPlayerError
(
PlaybackException
error
)
{
public
void
onPlayerError
(
PlaybackException
error
)
{
Callback
callback
=
getCallback
();
Callback
callback
=
getCallback
();
...
@@ -254,6 +270,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
...
@@ -254,6 +270,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
}
}
}
}
// dereference of possibly-null reference callback
@SuppressWarnings
(
"nullness:dereference.of.nullable"
)
@Override
@Override
public
void
onTimelineChanged
(
Timeline
timeline
,
@TimelineChangeReason
int
reason
)
{
public
void
onTimelineChanged
(
Timeline
timeline
,
@TimelineChangeReason
int
reason
)
{
Callback
callback
=
getCallback
();
Callback
callback
=
getCallback
();
...
@@ -262,6 +280,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
...
@@ -262,6 +280,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
callback
.
onBufferedPositionChanged
(
LeanbackPlayerAdapter
.
this
);
callback
.
onBufferedPositionChanged
(
LeanbackPlayerAdapter
.
this
);
}
}
// dereference of possibly-null reference callback
@SuppressWarnings
(
"nullness:dereference.of.nullable"
)
@Override
@Override
public
void
onPositionDiscontinuity
(
public
void
onPositionDiscontinuity
(
Player
.
PositionInfo
oldPosition
,
Player
.
PositionInfo
oldPosition
,
...
@@ -272,6 +292,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
...
@@ -272,6 +292,8 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
callback
.
onBufferedPositionChanged
(
LeanbackPlayerAdapter
.
this
);
callback
.
onBufferedPositionChanged
(
LeanbackPlayerAdapter
.
this
);
}
}
// dereference of possibly-null reference getCallback()
@SuppressWarnings
(
"nullness:dereference.of.nullable"
)
@Override
@Override
public
void
onVideoSizeChanged
(
VideoSize
videoSize
)
{
public
void
onVideoSizeChanged
(
VideoSize
videoSize
)
{
// There's no way to pass pixelWidthHeightRatio to leanback, so we scale the width that we
// There's no way to pass pixelWidthHeightRatio to leanback, so we scale the width that we
...
...
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