1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-03 05:44:14 +00:00

Reload on link properties changed on Android O only

This commit is contained in:
M66B 2017-08-08 18:05:47 +02:00
parent dd7d7a55ef
commit 76e94aa3e6

View file

@ -2196,7 +2196,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
registerReceiver(packageChangedReceiver, ifPackage); registerReceiver(packageChangedReceiver, ifPackage);
registeredPackageChanged = true; registeredPackageChanged = true;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
listenNetworkChanges(); listenNetworkChanges();
else else
listenConnectivityChanges(); listenConnectivityChanges();
@ -2232,7 +2232,8 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
@Override @Override
public void onLinkPropertiesChanged(Network network, LinkProperties linkProperties) { public void onLinkPropertiesChanged(Network network, LinkProperties linkProperties) {
reload("link properties changed", ServiceSinkhole.this, false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
reload("link properties changed", ServiceSinkhole.this, false);
} }
@Override @Override
@ -2414,7 +2415,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
registeredPackageChanged = false; registeredPackageChanged = false;
} }
if (networkCallback != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (networkCallback != null) {
unlistenNetworkChanges(); unlistenNetworkChanges();
networkCallback = null; networkCallback = null;
} }