Commit 79892751 authored by Mygod's avatar Mygod

Fix receiverRegistered not used

parent b2d3e9da
...@@ -79,8 +79,10 @@ class SubscriptionService : Service() { ...@@ -79,8 +79,10 @@ class SubscriptionService : Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
if (worker == null) { if (worker == null) {
idle.value = false idle.value = false
if (!receiverRegistered) registerReceiver(CancelReceiver, IntentFilter(Action.ABORT), if (!receiverRegistered) {
"$packageName.SERVICE", null) registerReceiver(CancelReceiver, IntentFilter(Action.ABORT), "$packageName.SERVICE", null)
receiverRegistered = true
}
worker = GlobalScope.launch { worker = GlobalScope.launch {
val urls = Subscription.instance.urls val urls = Subscription.instance.urls
val notification = NotificationCompat.Builder(this@SubscriptionService, NOTIFICATION_CHANNEL).apply { val notification = NotificationCompat.Builder(this@SubscriptionService, NOTIFICATION_CHANNEL).apply {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment