mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-04 16:15:09 +00:00
Device unpairs only on handshake exception, not on any exception
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
package org.kde.kdeconnect.Backends.LanBackend;
|
package org.kde.kdeconnect.Backends.LanBackend;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.net.wifi.WifiManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.v4.util.LongSparseArray;
|
import android.support.v4.util.LongSparseArray;
|
||||||
@@ -194,6 +195,7 @@ public class LanLinkProvider extends BaseLinkProvider {
|
|||||||
// Unpair if handshake failed
|
// Unpair if handshake failed
|
||||||
Log.e("KDE/LanLinkProvider", "Handshake failed with " + np.getString("deviceName"));
|
Log.e("KDE/LanLinkProvider", "Handshake failed with " + np.getString("deviceName"));
|
||||||
future.cause().printStackTrace();
|
future.cause().printStackTrace();
|
||||||
|
if (future.cause() instanceof SSLHandshakeException) {
|
||||||
BackgroundService.RunCommand(context, new BackgroundService.InstanceCallback() {
|
BackgroundService.RunCommand(context, new BackgroundService.InstanceCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onServiceStart(BackgroundService service) {
|
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 ?
|
// Any exception or handshake exception ?
|
||||||
Log.e("KDE/LanLinkProvider", "Handshake failed with " + identityPackage.getString("deviceName"));
|
Log.e("KDE/LanLinkProvider", "Handshake failed with " + identityPackage.getString("deviceName"));
|
||||||
future.cause().printStackTrace();
|
future.cause().printStackTrace();
|
||||||
|
if (future.cause() instanceof SSLHandshakeException) {
|
||||||
BackgroundService.RunCommand(context, new BackgroundService.InstanceCallback() {
|
BackgroundService.RunCommand(context, new BackgroundService.InstanceCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onServiceStart(BackgroundService service) {
|
public void onServiceStart(BackgroundService service) {
|
||||||
@@ -332,6 +335,7 @@ public class LanLinkProvider extends BaseLinkProvider {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user