Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
14
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
7b25c892
Commit
7b25c892
authored
4 years ago
by
Nicolas Pomepuy
Committed by
Geoffrey Métais
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Prevent PlaybackService loading notification bug
Fixes #1354
parent
9e1c2091
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!619
Prevent PlaybackService loading notification bug
Pipeline
#17907
passed with stage
in 17 minutes and 44 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+4
-4
4 additions, 4 deletions
...ation/vlc-android/src/org/videolan/vlc/PlaybackService.kt
with
4 additions
and
4 deletions
application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+
4
−
4
View file @
7b25c892
...
...
@@ -457,9 +457,9 @@ class PlaybackService : MediaBrowserServiceCompat(), LifecycleOwner {
@RequiresApi
(
Build
.
VERSION_CODES
.
O
)
override
fun
onCreate
()
{
dispatcher
.
onServicePreSuperOnCreate
()
setupScope
()
forceForeground
()
super
.
onCreate
()
setupScope
()
NotificationHelper
.
createNotificationChannels
(
applicationContext
)
settings
=
Settings
.
getInstance
(
this
)
playlistManager
=
PlaylistManager
(
this
)
...
...
@@ -588,13 +588,13 @@ class PlaybackService : MediaBrowserServiceCompat(), LifecycleOwner {
private
fun
forceForeground
()
{
if
(!
AndroidUtil
.
isOOrLater
||
isForeground
)
return
val
ctx
=
applicationContext
val
stopped
=
PlayerController
.
playbackState
==
PlaybackStateCompat
.
STATE_STOPPED
val
stopped
=
PlayerController
.
playbackState
==
PlaybackStateCompat
.
STATE_STOPPED
||
PlayerController
.
playbackState
==
PlaybackStateCompat
.
STATE_NONE
val
notification
=
if
(
this
::
notification
.
isInitialized
&&
!
stopped
)
notification
else
{
val
pi
=
if
(
::
playlistManager
.
isInitialized
)
sessionPendingIntent
else
null
NotificationHelper
.
createPlaybackNotification
(
ctx
,
false
,
ctx
.
resources
.
getString
(
R
.
string
.
loading
),
""
,
""
,
null
,
false
,
true
,
null
,
pi
)
ctx
.
resources
.
getString
(
R
.
string
.
loading
),
""
,
""
,
null
,
false
,
true
,
null
,
pi
)
}
startForeground
(
3
,
notification
)
isForeground
=
true
...
...
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