Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
530
Issue boards
Milestones
Wiki
Code
Merge requests
15
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
13fe216b
There was an error fetching the commit references. Please try again later.
Commit
13fe216b
authored
4 years ago
by
Robert Stone
Committed by
Nicolas Pomepuy
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Replace array copies with a sublist
parent
9986dc03
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
+6
-7
6 additions, 7 deletions
.../vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
with
6 additions
and
7 deletions
application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
+
6
−
7
View file @
13fe216b
...
...
@@ -16,7 +16,6 @@ import org.videolan.resources.MEDIALIBRARY_PAGE_SIZE
import
org.videolan.resources.util.getFromMl
import
org.videolan.vlc.extensions.ExtensionsManager
import
org.videolan.vlc.media.MediaSessionBrowser
import
org.videolan.vlc.media.MediaSessionBrowser.Companion.MAX_HISTORY_SIZE
import
org.videolan.vlc.util.VoiceSearchParams
import
org.videolan.vlc.util.awaitMedialibraryStarted
import
java.util.*
...
...
@@ -74,16 +73,16 @@ internal class MediaSessionCallback(private val playbackService: PlaybackService
}
}
mediaId
==
MediaSessionBrowser
.
ID_LAST_ADDED
->
{
val
tracks
=
context
.
getFromMl
{
recentAudio
}
if
(
tracks
.
isN
ot
Empty
()
&&
isActive
)
{
val
mediaList
=
tracks
.
copyOfRange
(
0
,
tracks
.
size
.
coerceAtMost
(
MediaSessionBrowser
.
MAX_HISTORY_SIZE
))
val
tracks
=
context
.
getFromMl
{
recentAudio
?.
toList
()
}
if
(
!
tracks
.
isN
ullOr
Empty
()
&&
isActive
)
{
val
mediaList
=
tracks
.
subList
(
0
,
tracks
.
size
.
coerceAtMost
(
MediaSessionBrowser
.
MAX_HISTORY_SIZE
))
playbackService
.
load
(
mediaList
,
0
)
}
}
mediaId
==
MediaSessionBrowser
.
ID_HISTORY
->
{
val
tracks
=
context
.
getFromMl
{
lastMediaPlayed
()
}
if
(
tracks
.
isN
ot
Empty
()
&&
isActive
)
{
val
mediaList
=
tracks
.
copyOfRange
(
0
,
tracks
.
size
.
coerceAtMost
(
MediaSessionBrowser
.
MAX_HISTORY_SIZE
))
val
tracks
=
context
.
getFromMl
{
lastMediaPlayed
()
?.
toList
()
}
if
(
!
tracks
.
isN
ullOr
Empty
()
&&
isActive
)
{
val
mediaList
=
tracks
.
subList
(
0
,
tracks
.
size
.
coerceAtMost
(
MediaSessionBrowser
.
MAX_HISTORY_SIZE
))
playbackService
.
load
(
mediaList
,
0
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment