Skip onAvailable on Android O+

pull/195/head
M66B 4 years ago
parent a80a8c66c7
commit 8852867f6e

@ -2030,6 +2030,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
private final ConnectivityManager.NetworkCallback networkCallback = new ConnectivityManager.NetworkCallback() {
@Override
public void onAvailable(@NonNull Network network) {
// Android O+: this will always immediately be followed by a call to onCapabilitiesChanged/onLinkPropertiesChanged
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
updateNetworkState(network, "available");
}

Loading…
Cancel
Save