mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
a336677191
commit
2b2a8dda20
@ -9,7 +9,6 @@ import io.legado.app.help.LifecycleHelp
|
||||
import io.legado.app.help.coroutine.Coroutine
|
||||
import io.legado.app.lib.permission.Permissions
|
||||
import io.legado.app.lib.permission.PermissionsCompat
|
||||
import io.legado.app.utils.printOnDebug
|
||||
import kotlinx.coroutines.*
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
|
||||
@ -63,10 +62,8 @@ abstract class BaseService : LifecycleService(), CoroutineScope by MainScope() {
|
||||
.addPermissions(Permissions.POST_NOTIFICATIONS)
|
||||
.rationale(R.string.notification_permission_rationale)
|
||||
.onGranted {
|
||||
kotlin.runCatching {
|
||||
if (isActive) {
|
||||
upNotification()
|
||||
}.onFailure {
|
||||
it.printOnDebug()
|
||||
}
|
||||
}
|
||||
.request()
|
||||
|
Loading…
Reference in New Issue
Block a user