fix(tcp): stop emitting redundant permanent disconnect from close()

TcpRadioTransport.close() unconditionally emitted onDisconnect with
isPermanent=true. The 'closing' guard at the listener level already
suppresses the transient signal during teardown, and the explicit-
disconnect emit is owned by SharedRadioInterfaceService.stopTransportLocked.
The double-emit caused two terminal disconnect events for one user action
and prevented the auto-reconnect loop from cleanly owning its lifecycle.
This commit is contained in:
James Rich 2026-04-19 12:45:34 -05:00
parent 2137ef3410
commit 0e47dc6717

View file

@ -78,7 +78,11 @@ open class TcpRadioTransport(
Logger.d { "[$address] Closing TCP transport" }
closing = true
transport.stop()
callback.onDisconnect(isPermanent = true)
// Do NOT emit onDisconnect(isPermanent = true) here. The explicit-disconnect signal is the
// service layer's responsibility (SharedRadioInterfaceService.stopTransportLocked); emitting
// it from close() caused a double-disconnect and prevented the auto-reconnect loop from
// owning its own lifecycle. The `closing` guard above suppresses the listener's transient
// disconnect during teardown.
}
override fun keepAlive() {