diff --git a/app/build.gradle b/app/build.gradle index a3f850ff8..00f4935df 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,8 +24,8 @@ def gitHash() { return "git -C ${rootDir} rev-parse --short HEAD".execute().text.trim() } -def version = "1.2.0-beta1" -def version_code = 116 +def version = "1.2.0" +def version_code = 117 android { compileSdkVersion 30 diff --git a/app/src/main/kotlin/com/kelsos/mbrc/controller/RemoteService.kt b/app/src/main/kotlin/com/kelsos/mbrc/controller/RemoteService.kt index 9d1f59b1d..9bd37d645 100644 --- a/app/src/main/kotlin/com/kelsos/mbrc/controller/RemoteService.kt +++ b/app/src/main/kotlin/com/kelsos/mbrc/controller/RemoteService.kt @@ -36,7 +36,7 @@ class RemoteService : Service(), ForegroundHooks { @Inject lateinit var notificationService: NotificationService - private lateinit var threadPoolExecutor: ExecutorService + private var threadPoolExecutor: ExecutorService? = null private lateinit var scope: Scope override fun onBind(intent: Intent?): IBinder { @@ -56,8 +56,9 @@ class RemoteService : Service(), ForegroundHooks { CommandRegistration.register(remoteController, scope) threadPoolExecutor = Executors.newSingleThreadExecutor { Thread(it, "message-thread") + }.apply { + execute(remoteController) } - threadPoolExecutor.execute(remoteController) remoteController.executeCommand(MessageEvent(UserInputEventType.StartConnection)) discovery.startDiscovery() @@ -71,7 +72,7 @@ class RemoteService : Service(), ForegroundHooks { remoteController.executeCommand(MessageEvent(UserInputEventType.CancelNotification)) remoteController.executeCommand(MessageEvent(UserInputEventType.TerminateConnection)) CommandRegistration.unregister(remoteController) - threadPoolExecutor.shutdownNow() + threadPoolExecutor?.shutdownNow() Timber.d("Background Service::Destroyed") Toothpick.closeScope(this) } diff --git a/app/src/main/res/raw/changelog.xml b/app/src/main/res/raw/changelog.xml index 763d6bc49..36306f229 100644 --- a/app/src/main/res/raw/changelog.xml +++ b/app/src/main/res/raw/changelog.xml @@ -1,5 +1,10 @@ + + Fixes a background crash with the application service. +