2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 09:58:08 +00:00

8 Commits

Author SHA1 Message Date
Albert Vaca Cintora
6fc5ae66b8 Add license headers to files missing it 2023-06-05 12:21:15 +02:00
Albert Vaca Cintora
a20fb00b7d Have a single PairingHandler for all links 2023-06-05 10:28:45 +02:00
Albert Vaca Cintora
58a304a81e Catch SocketException from sendPacket
So we get to print the error message saying which packet got lost and so
that the sending loop doesn't crash.
2023-05-24 17:08:40 +00:00
Albert Vaca Cintora
00f3fc43d0 Make linter happy: add final 2023-03-05 23:47:42 +01:00
Wojciech Matuszewski
70d70dcb33 Use a common thread pool instead of creating new threads manually
## Summary

Spawning new threads in Java is costly. This MR aims to use a common thread pool instead.

I've replaced all cases where a new thread is started just to perform a task in the background. This does not include cases where a reference to the newly created thread is kept as a part of application logic – this is probably a problem in itself, but it exceeds the scope of this quick optimization. ;) 

There was a couple of cases where a new thread was spawned just to sleep for a while an then change the state on a View on the main thread. I've replaced those with posting those deferred tasks to the View's message queue.

## Test Plan

Everything should work the same as it has before, just a bit faster and easier on the memory.
2022-10-31 20:59:17 +00:00
Isira Seneviratne
847a949ace Use the Streams API in DevicePacketQueue. 2020-07-10 18:22:42 +05:30
Matthijs Tijink
d5b697f2c4 Don't remove packets from the queue without adding a replacing one 2019-07-20 22:28:54 +02:00
Matthijs Tijink
66aa6696cc Use a queue of unsent packets instead of threads
This also allows "unsending" packets (if they're still in the queue).
This patch does that for mouse move packets, so they get accumulated
together (sending less stuff over a congested link).
2019-07-20 20:21:44 +00:00