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

Device unpairs only on handshake exception, not on any exception

This commit is contained in:
Vineet Garg
2015-08-20 19:15:51 +05:30
parent 6a4f0e79a9
commit 8556e9399e

View File

@@ -21,6 +21,7 @@
package org.kde.kdeconnect.Backends.LanBackend;
import android.content.Context;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.preference.PreferenceManager;
import android.support.v4.util.LongSparseArray;
@@ -194,6 +195,7 @@ public class LanLinkProvider extends BaseLinkProvider {
// Unpair if handshake failed
Log.e("KDE/LanLinkProvider", "Handshake failed with " + np.getString("deviceName"));
future.cause().printStackTrace();
if (future.cause() instanceof SSLHandshakeException) {
BackgroundService.RunCommand(context, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(BackgroundService service) {
@@ -203,6 +205,7 @@ public class LanLinkProvider extends BaseLinkProvider {
}
});
}
}
}
});
@@ -322,7 +325,7 @@ public class LanLinkProvider extends BaseLinkProvider {
// Any exception or handshake exception ?
Log.e("KDE/LanLinkProvider", "Handshake failed with " + identityPackage.getString("deviceName"));
future.cause().printStackTrace();
if (future.cause() instanceof SSLHandshakeException) {
BackgroundService.RunCommand(context, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(BackgroundService service) {
@@ -332,6 +335,7 @@ public class LanLinkProvider extends BaseLinkProvider {
}
});
}
}
}
});