mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 12:05:30 +00:00
Rename method
This commit is contained in:
parent
01efe7a4ea
commit
6bd4006652
@ -100,7 +100,7 @@ open class DownloadService : BaseDownloader() {
|
||||
}
|
||||
}
|
||||
|
||||
operator fun invoke(context: Context, subject: Subject) {
|
||||
fun start(context: Context, subject: Subject) {
|
||||
val app = context.applicationContext
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
app.startForegroundService(intent(app, subject))
|
||||
|
@ -31,7 +31,7 @@ class EnvFixDialog : DialogEvent() {
|
||||
lbm.unregisterReceiver(this)
|
||||
}
|
||||
}, IntentFilter(DISMISS))
|
||||
DownloadService(dialog.context, Magisk(EnvFix))
|
||||
DownloadService.start(dialog.context, Magisk(EnvFix))
|
||||
}
|
||||
}
|
||||
.applyButton(MagiskDialog.ButtonType.NEGATIVE) {
|
||||
|
@ -25,7 +25,7 @@ class ManagerInstallDialog : DialogEvent() {
|
||||
|
||||
applyButton(MagiskDialog.ButtonType.POSITIVE) {
|
||||
titleRes = R.string.install
|
||||
onClick { DownloadService(context, subject) }
|
||||
onClick { DownloadService.start(context, subject) }
|
||||
}
|
||||
|
||||
if (Info.remote.app.note.isEmpty()) return
|
||||
|
@ -15,7 +15,7 @@ class ModuleInstallDialog(private val item: Repo) : DialogEvent() {
|
||||
fun download(install: Boolean) {
|
||||
val config = if (install) Action.Flash.Primary else Action.Download
|
||||
val subject = Subject.Module(item, config)
|
||||
DownloadService(context, subject)
|
||||
DownloadService.start(context, subject)
|
||||
}
|
||||
|
||||
applyTitle(context.getString(R.string.repo_install_title, item.name))
|
||||
|
@ -47,7 +47,7 @@ class UninstallDialog : DialogEvent() {
|
||||
}
|
||||
|
||||
private fun completeUninstall() {
|
||||
DownloadService(dialog.context, Subject.Magisk(Action.Uninstall))
|
||||
DownloadService.start(dialog.context, Subject.Magisk(Action.Uninstall))
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -78,8 +78,10 @@ class InstallViewModel(
|
||||
step = nextStep
|
||||
}
|
||||
|
||||
fun install() =
|
||||
DownloadService(get(), Subject.Magisk(resolveAction())).also { state = State.LOADING }
|
||||
fun install() {
|
||||
DownloadService.start(get(), Subject.Magisk(resolveAction()))
|
||||
state = State.LOADING
|
||||
}
|
||||
|
||||
// ---
|
||||
|
||||
|
@ -145,7 +145,7 @@ class SettingsViewModel(
|
||||
}
|
||||
|
||||
private fun restoreManager() {
|
||||
DownloadService(get(), Subject.Manager(Action.APK.Restore))
|
||||
DownloadService.start(get(), Subject.Manager(Action.APK.Restore))
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user