mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
3346d0d49e
commit
4e0959ba36
@ -44,6 +44,15 @@ class WebService : BaseService() {
|
||||
upTile(true)
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
when (intent?.action) {
|
||||
IntentAction.stop -> stopSelf()
|
||||
"copyHostAddress" -> sendToClip(hostAddress)
|
||||
else -> upWebServer()
|
||||
}
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
isRun = false
|
||||
@ -57,15 +66,6 @@ class WebService : BaseService() {
|
||||
upTile(false)
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
when (intent?.action) {
|
||||
IntentAction.stop -> stopSelf()
|
||||
"copyHostAddress" -> sendToClip(hostAddress)
|
||||
else -> upWebServer()
|
||||
}
|
||||
return super.onStartCommand(intent, flags, startId)
|
||||
}
|
||||
|
||||
private fun upWebServer() {
|
||||
if (httpServer?.isAlive == true) {
|
||||
httpServer?.stop()
|
||||
|
Loading…
Reference in New Issue
Block a user