2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 13:47:41 +00:00

Unpair on error

This commit is contained in:
Albert Vaca
2016-08-25 18:06:56 +02:00
parent 1d5efe36f0
commit 14e97545e4

View File

@@ -249,6 +249,15 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
}
} catch (Exception e) {
e.printStackTrace();
BackgroundService.RunCommand(context, new BackgroundService.InstanceCallback() {
@Override
public void onServiceStart(BackgroundService service) {
Device device = service.getDevice(deviceId);
Log.e("LanLinkProvider", "Unpairing "+(device != null));
if (device == null) return;
device.unpair();
}
});
}
}