Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
ed4d0867
Commit
ed4d0867
authored
Mar 24, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure navigation happens on main thread
Fix #4044
parent
1c71e024
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
DownloadService.kt
...ava/com/topjohnwu/magisk/core/download/DownloadService.kt
+5
-5
No files found.
app/src/main/java/com/topjohnwu/magisk/core/download/DownloadService.kt
View file @
ed4d0867
package
com.topjohnwu.magisk.core.download
import
android.annotation.SuppressLint
import
android.app.Notification
import
android.app.PendingIntent
import
android.content.Context
...
...
@@ -15,9 +14,9 @@ import com.topjohnwu.magisk.core.download.Subject.Module
import
com.topjohnwu.magisk.core.intent
import
com.topjohnwu.magisk.ui.flash.FlashFragment
import
com.topjohnwu.magisk.utils.APKInstall
import
com.topjohnwu.superuser.internal.UiThreadHandler
import
kotlin.random.Random.Default.nextInt
@SuppressLint
(
"Registered"
)
open
class
DownloadService
:
BaseDownloader
()
{
private
val
context
get
()
=
this
...
...
@@ -29,9 +28,10 @@ open class DownloadService : BaseDownloader() {
private
fun
Module
.
onFinish
(
id
:
Int
)
=
when
(
action
)
{
Flash
->
{
(
ForegroundTracker
.
foreground
as
?
BaseUIActivity
<*,
*>)
?.
navigation
?.
navigate
(
FlashFragment
.
install
(
file
,
id
))
Unit
UiThreadHandler
.
run
{
(
ForegroundTracker
.
foreground
as
?
BaseUIActivity
<*,
*>)
?.
navigation
?.
navigate
(
FlashFragment
.
install
(
file
,
id
))
}
}
else
->
Unit
}
...
...
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