mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 05:27:28 +01:00
Minor cleanup
This commit is contained in:
@@ -44,12 +44,12 @@ class BackupRestoreService : Service() {
|
||||
* @param uri path of Uri
|
||||
*/
|
||||
fun start(context: Context, uri: Uri) {
|
||||
if (!isRunning(context)) {
|
||||
val intent = Intent(context, BackupRestoreService::class.java).apply {
|
||||
putExtra(BackupConst.EXTRA_URI, uri)
|
||||
}
|
||||
ContextCompat.startForegroundService(context, intent)
|
||||
if (isRunning(context)) return
|
||||
|
||||
val intent = Intent(context, BackupRestoreService::class.java).apply {
|
||||
putExtra(BackupConst.EXTRA_URI, uri)
|
||||
}
|
||||
ContextCompat.startForegroundService(context, intent)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -166,13 +166,13 @@ class AppUpdateService : Service() {
|
||||
* @param url the url to the new update.
|
||||
*/
|
||||
fun start(context: Context, url: String, title: String? = context.getString(R.string.app_name)) {
|
||||
if (!isRunning(context)) {
|
||||
val intent = Intent(context, AppUpdateService::class.java).apply {
|
||||
putExtra(EXTRA_DOWNLOAD_TITLE, title)
|
||||
putExtra(EXTRA_DOWNLOAD_URL, url)
|
||||
}
|
||||
ContextCompat.startForegroundService(context, intent)
|
||||
if (isRunning(context)) return
|
||||
|
||||
val intent = Intent(context, AppUpdateService::class.java).apply {
|
||||
putExtra(EXTRA_DOWNLOAD_TITLE, title)
|
||||
putExtra(EXTRA_DOWNLOAD_URL, url)
|
||||
}
|
||||
ContextCompat.startForegroundService(context, intent)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user