优化
This commit is contained in:
@@ -83,6 +83,7 @@ class DownloadService : BaseService() {
|
||||
toastOnUi("已在下载列表")
|
||||
return
|
||||
}
|
||||
kotlin.runCatching {
|
||||
// 指定下载地址
|
||||
val request = DownloadManager.Request(Uri.parse(url))
|
||||
// 设置通知
|
||||
@@ -96,6 +97,12 @@ class DownloadService : BaseService() {
|
||||
if (upStateJob == null) {
|
||||
checkDownloadState()
|
||||
}
|
||||
}.onFailure {
|
||||
when (it) {
|
||||
is SecurityException -> toastOnUi("下载出错,没有存储权限")
|
||||
else -> toastOnUi("下载出错,${it.localizedMessage}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
|
||||
Reference in New Issue
Block a user