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

Do not unpair automatically on error, just ignore the connection

This commit is contained in:
Albert Vaca Cintora 2025-02-01 11:16:11 +01:00
parent 7a4fb8b584
commit 68a0b73e9c

View File

@ -223,10 +223,6 @@ public class LanLinkProvider extends BaseLinkProvider {
if (deviceTrusted && !SslHelper.isCertificateStored(context, deviceId)) { if (deviceTrusted && !SslHelper.isCertificateStored(context, deviceId)) {
Log.e("KDE/LanLinkProvider", "Device trusted but no cert stored. This should not happen."); Log.e("KDE/LanLinkProvider", "Device trusted but no cert stored. This should not happen.");
Device device = KdeConnect.getInstance().getDevice(deviceId);
if (device != null) {
device.unpair();
}
return; return;
} }
@ -261,16 +257,8 @@ public class LanLinkProvider extends BaseLinkProvider {
addOrUpdateLink(sslSocket, deviceInfo); addOrUpdateLink(sslSocket, deviceInfo);
} catch (JSONException e) { } catch (JSONException e) {
Log.e("KDE/LanLinkProvider", "Remote device doesn't correctly implement protocol version 8", e); Log.e("KDE/LanLinkProvider", "Remote device doesn't correctly implement protocol version 8", e);
Device device = KdeConnect.getInstance().getDevice(deviceId);
if (device != null) {
device.unpair();
}
} catch (IOException e) { } catch (IOException e) {
Log.e("KDE/LanLinkProvider", "Handshake as " + mode + " failed with " + deviceName, e); Log.e("KDE/LanLinkProvider", "Handshake as " + mode + " failed with " + deviceName, e);
Device device = KdeConnect.getInstance().getDevice(deviceId);
if (device != null) {
device.unpair();
}
} }
}); });