mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix multiple startInterface() calls
This commit is contained in:
parent
613334d87e
commit
7905bc6f70
2 changed files with 2 additions and 10 deletions
|
|
@ -937,14 +937,6 @@ class MainActivity : BaseActivity(), Logging,
|
|||
model.meshService = null
|
||||
}
|
||||
|
||||
override fun onBackPressed() { // FIXME Override back button to avoid closing
|
||||
if (supportFragmentManager.backStackEntryCount == 0) {
|
||||
moveTaskToBack(false)
|
||||
} else {
|
||||
super.onBackPressed()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
unregisterMeshReceiver() // No point in receiving updates while the GUI is gone, we'll get them when the user launches the activity
|
||||
unbindMeshService()
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class RadioInterfaceService @Inject constructor(
|
|||
private val processLifecycle: Lifecycle,
|
||||
private val usbRepository: UsbRepository,
|
||||
@RadioRepositoryQualifier private val prefs: SharedPreferences
|
||||
): Logging {
|
||||
) : Logging {
|
||||
|
||||
private val _connectionState = MutableStateFlow(RadioServiceConnectionState())
|
||||
val connectionState = _connectionState.asStateFlow()
|
||||
|
|
@ -73,7 +73,7 @@ class RadioInterfaceService @Inject constructor(
|
|||
processLifecycle.coroutineScope.launch {
|
||||
bluetoothRepository.state.collect { state ->
|
||||
if (state.enabled) {
|
||||
startInterface()
|
||||
// startInterface() FIXME no longer safe to call here, crashing SafeBluetooth.asyncConnect
|
||||
} else if (radioIf is BluetoothInterface) {
|
||||
stopInterface()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue