From 71b034a0256d4b5767d7989d1fa8f0f927cfd23d Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Thu, 13 Jun 2019 17:33:21 +0000 Subject: [PATCH] Fix packet loss after connection --- src/org/kde/kdeconnect/Device.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/org/kde/kdeconnect/Device.java b/src/org/kde/kdeconnect/Device.java index 94bc572d..386e803d 100644 --- a/src/org/kde/kdeconnect/Device.java +++ b/src/org/kde/kdeconnect/Device.java @@ -421,6 +421,8 @@ public class Device implements BaseLink.PacketReceiver { public void addLink(NetworkPacket identityPacket, BaseLink link) { //FilesHelper.LogOpenFileCount(); + links.add(link); + link.addPacketReceiver(this); this.protocolVersion = identityPacket.getInt("protocolVersion"); @@ -448,9 +450,6 @@ public class Device implements BaseLink.PacketReceiver { } } - - links.add(link); - try { SharedPreferences globalSettings = PreferenceManager.getDefaultSharedPreferences(context); byte[] privateKeyBytes = Base64.decode(globalSettings.getString("privateKey", ""), 0); @@ -499,7 +498,6 @@ public class Device implements BaseLink.PacketReceiver { supportedPlugins = new Vector<>(PluginFactory.getAvailablePlugins()); } - link.addPacketReceiver(this); reloadPluginsFromSettings();