do not run automation in main thread
This commit is contained in:
parent
c2ae713cc4
commit
9361010e46
1 changed files with 2 additions and 2 deletions
|
@ -4,6 +4,7 @@ import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
|
import android.os.HandlerThread
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.events.EventBTChange
|
import info.nightscout.androidaps.events.EventBTChange
|
||||||
|
@ -39,7 +40,6 @@ import org.json.JSONException
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
import kotlin.collections.ArrayList
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class AutomationPlugin @Inject constructor(
|
class AutomationPlugin @Inject constructor(
|
||||||
|
@ -71,7 +71,7 @@ class AutomationPlugin @Inject constructor(
|
||||||
var executionLog: MutableList<String> = ArrayList()
|
var executionLog: MutableList<String> = ArrayList()
|
||||||
var btConnects : MutableList<EventBTChange> = ArrayList()
|
var btConnects : MutableList<EventBTChange> = ArrayList()
|
||||||
|
|
||||||
private val loopHandler = Handler()
|
private val loopHandler : Handler = Handler(HandlerThread(AutomationPlugin::class.java.simpleName + "Handler").also { it.start() }.looper)
|
||||||
private lateinit var refreshLoop: Runnable
|
private lateinit var refreshLoop: Runnable
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
Loading…
Reference in a new issue