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

Starkly reduce crashing

This commit is contained in:
Simon Redman
2019-07-20 19:39:33 +02:00
committed by Albert Vaca Cintora
parent e77978d1d5
commit ec638fdbec

View File

@@ -401,6 +401,7 @@ public class MulticastLinkProvider extends BaseLinkProvider implements Multicast
@Override
public void onDiscoveryStopped(String serviceType) {
Log.i(LOG_TAG, "Discovery stopped: " + serviceType);
listening = false;
}
@Override
@@ -448,8 +449,9 @@ public class MulticastLinkProvider extends BaseLinkProvider implements Multicast
// This backend does not work on older Android versions
return;
}
if (mNsdManager != null) {
if (listening) {
mNsdManager.unregisterService(mRegistrationListener);
listening = false;
}
if (NetworkHelper.isOnMobileNetwork(context)) {