2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 14:15:14 +00:00

Unpair also if handshake fails but the callback is not called

This commit is contained in:
Albert Vaca
2016-07-13 18:12:12 +02:00
parent 53117c9a4b
commit 2c0d9af64d

View File

@@ -231,7 +231,16 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
try {
sslsocket.startHandshake();
} catch (Exception e) {
Log.e("KDE/LanLinkProvider","Handshake failed with " + identityPackage.getString("deviceName"));
e.printStackTrace();
BackgroundService.RunCommand(context, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(BackgroundService service) {
Device device = service.getDevice(deviceId);
if (device == null) return;
device.unpair();
}
});
}
}
}).start();