|
|
@ -18,6 +18,7 @@ class DownloadService : BaseService() { |
|
|
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { |
|
|
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { |
|
|
|
intent?.action?.let { action -> |
|
|
|
intent?.action?.let { action -> |
|
|
|
when (action) { |
|
|
|
when (action) { |
|
|
|
|
|
|
|
Action.start -> download() |
|
|
|
Action.stop -> stopSelf() |
|
|
|
Action.stop -> stopSelf() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -28,6 +29,10 @@ class DownloadService : BaseService() { |
|
|
|
super.onDestroy() |
|
|
|
super.onDestroy() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun download() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 更新通知 |
|
|
|
* 更新通知 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|