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:
parent
dd7d7a55ef
commit
76e94aa3e6
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue