Prevent Android 8.1 crash
Summary:
The SSL/TLS handshake code in LanLinkProvider is normally invoked in parallel, so that multiple incoming messages can be read at once. However, this logic causes an unusual crash in Android 8.1's native openssl library.
Sample logcat of crash is available at https://paste.kde.org/ptolqcpya
This patch mitigates the issue by making the addLink function in that class synchronized. I recommend future work to determine whether there are any other thread-safety concerns in the handshake code.
Test Plan:
- Designate a test wi-fi network
- Disconnect all KDE Connect devices from that network
- Install build on disconnected Android 8.1 device
- Clear KDE Connect app data (if present) on 8.1 device
- Connect 8.1 device to test wi-fi network
- Connect any other KDE Connect device to test wi-fi network
Reviewers: albertvaka
Reviewed By: albertvaka
Differential Revision: https://phabricator.kde.org/D9739