MedtronicFragment synchronized

This commit is contained in:
Milos Kozak 2019-08-15 17:11:07 +02:00
parent 1cb93c630d
commit bfedc3d9d7

View file

@ -111,6 +111,7 @@ class MedtronicFragment : Fragment() {
updateGUI() updateGUI()
} }
@Synchronized
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
MainApp.bus().register(this) MainApp.bus().register(this)
@ -142,6 +143,7 @@ class MedtronicFragment : Fragment() {
}, { FabricPrivacy.logException(it) }) }, { FabricPrivacy.logException(it) })
} }
@Synchronized
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
disposable.clear() disposable.clear()
@ -249,7 +251,9 @@ class MedtronicFragment : Fragment() {
} }
// GUI functions // GUI functions
@Synchronized
fun updateGUI() { fun updateGUI() {
if (medtronic_rl_status == null) return
val plugin = MedtronicPumpPlugin.getPlugin() val plugin = MedtronicPumpPlugin.getPlugin()
val pumpStatus = MedtronicUtil.getPumpStatus() val pumpStatus = MedtronicUtil.getPumpStatus()