combov2: Revert accidental change to onStart()

The change came from commit 963016ef5d

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
This commit is contained in:
Carlos Rafael Giani 2022-11-26 10:23:18 +01:00
parent 7fae8335a6
commit 20ca4f1f4b

View file

@ -228,31 +228,30 @@ class ComboV2Plugin @Inject constructor (
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
pumpCoroutineScope.launch {
aapsLogger.debug(LTag.PUMP, "Creating bluetooth interface")
bluetoothInterface = AndroidBluetoothInterface(context)
aapsLogger.debug(LTag.PUMP, "Setting up bluetooth interface") aapsLogger.debug(LTag.PUMP, "Creating bluetooth interface")
bluetoothInterface!!.setup() bluetoothInterface = AndroidBluetoothInterface(context)
aapsLogger.debug(LTag.PUMP, "Setting up pump manager") aapsLogger.debug(LTag.PUMP, "Setting up bluetooth interface")
pumpManager = ComboCtlPumpManager(bluetoothInterface!!, pumpStateStore) bluetoothInterface!!.setup()
pumpManager!!.setup {
_pairedStateUIFlow.value = false
}
// UI flows that must have defined values right aapsLogger.debug(LTag.PUMP, "Setting up pump manager")
// at start are initialized here. pumpManager = ComboCtlPumpManager(bluetoothInterface!!, pumpStateStore)
pumpManager!!.setup {
// The paired state UI flow is special in that it is also _pairedStateUIFlow.value = false
// used as the backing store for the isPaired() function,
// so setting up that UI state flow equals updating that
// paired state.
val paired = pumpManager!!.getPairedPumpAddresses().isNotEmpty()
_pairedStateUIFlow.value = paired
setDriverState(DriverState.Disconnected)
} }
// UI flows that must have defined values right
// at start are initialized here.
// The paired state UI flow is special in that it is also
// used as the backing store for the isPaired() function,
// so setting up that UI state flow equals updating that
// paired state.
val paired = pumpManager!!.getPairedPumpAddresses().isNotEmpty()
_pairedStateUIFlow.value = paired
setDriverState(DriverState.Disconnected)
} }
override fun onStop() { override fun onStop() {