remotekeyboard icon indicating copy to clipboard operation
remotekeyboard copied to clipboard

Exception on disabling

Open Starcommander opened this issue 5 years ago • 1 comments

When remote-keyboard is activated, and telnet is connected, then switching keyboard fails. The exception occurs:

2187 12187 E Connection: android.os.NetworkOnMainThreadException 12-23 21:53:01.609 12187 12187 E Connection: at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303) 12-23 21:53:01.609 12187 12187 E Connection: at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111) ........... 2187 12187 E Connection: at net.wimpi.telnetd.TelnetD.stop(TelnetD.java:96) 12-23 21:53:01.609 12187 12187 E Connection: at de.onyxbits.remotekeyboard.RemoteKeyboardService.onDestroy(RemoteKeyboardService.java:124) 12-23 21:53:01.609 12187 12187 E Connection: at android.app.ActivityThread.handleStopService(ActivityThread.java:3396)

The notification does not disapear in this case, and it looks like remote-keyboard is still active. Disabling the TelnetConnection must be done in a thread. --> RemoteKeyboardService.java:124

Starcommander avatar Dec 24 '19 00:12 Starcommander

My suggestion instead of telnetServer.stop();

Runnable rStop = new Runnable() { public void run() {telnetServer.stop();} };
new Thread(rStop).start();

Starcommander avatar Dec 24 '19 00:12 Starcommander