Allow switch from remote to local computer when disconnected. (#18085)
Fixes #18081.
Summary of the issue:
When using NVDA Remote Access, if you are disconnected from the remote
server while controlling the remote computer, it is impossible to switch
back to the local computer.
Description of user facing changes
It is now possible to switch back to the local computer in this
situation.
Description of development approach
1. In `RemoteClient.toggleRemoteKeyControl`, only check if we're
disconnected when switching to the remote computer. If we're switching
to the local computer, allow the switch regardless of the connection
status.
2. In `TCPTransport.send`, log the disconnected error as a debugWarning
instead of an error to prevent spurious error sounds in this case, since
it is an expected, albeit less common, scenario.
I considered returning control to the local computer immediately when
the server disconnects. However, there are two problems with this that
made me decide against it:
1. It is risky because the user might press keys thinking they are going
to the remote computer, when they're actually going to the local
computer. Switching should always be an explicit user action.
2. The disconnection might be temporary and the user shouldn't have to
switch again in that case.
Testing strategy:
Followed the steps to reproduce from #18081. Verified the expected
result.