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
01728559
Commit
01728559
authored
2 years ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Avoid useless try to start the service in background
parent
9fdea53b
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/resources/src/main/java/org/videolan/resources/util/Extensions.kt
+4
-10
4 additions, 10 deletions
...s/src/main/java/org/videolan/resources/util/Extensions.kt
with
4 additions
and
10 deletions
application/resources/src/main/java/org/videolan/resources/util/Extensions.kt
+
4
−
10
View file @
01728559
...
...
@@ -14,7 +14,6 @@ import org.videolan.medialibrary.interfaces.Medialibrary
import
org.videolan.resources.*
import
org.videolan.tools.*
import
java.io.File
import
java.util.ArrayList
import
kotlin.coroutines.resume
...
...
@@ -92,15 +91,10 @@ suspend fun Context.dbExists(coroutineContextProvider: CoroutineContextProvider
}
fun
Context
.
launchForeground
(
intent
:
Intent
)
{
try
{
startService
(
intent
)
}
catch
(
e
:
IllegalStateException
)
{
//wait for the UI thread to be ready
val
ctx
=
this
AppScope
.
launch
(
Dispatchers
.
Main
)
{
intent
.
putExtra
(
"foreground"
,
true
)
ContextCompat
.
startForegroundService
(
ctx
,
intent
)
}
val
ctx
=
this
AppScope
.
launch
(
Dispatchers
.
Main
)
{
intent
.
putExtra
(
"foreground"
,
true
)
ContextCompat
.
startForegroundService
(
ctx
,
intent
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Nicolas Pomepuy
@Aza
mentioned in commit
8015467c
·
2 years ago
mentioned in commit
8015467c
mentioned in commit 8015467c1137840dcd5315c2ada5b356b99dc451
Toggle commit list
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