Skip onAvailable on Android O+

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

@ -2030,7 +2030,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
private final ConnectivityManager.NetworkCallback networkCallback = new ConnectivityManager.NetworkCallback() {
@Override
public void onAvailable(@NonNull Network network) {
updateNetworkState(network, "available");
// 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");
}
@Override

Loading…
Cancel
Save