1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 04:35:57 +00:00

Skip onAvailable on Android O+

This commit is contained in:
M66B 2021-03-17 12:15:25 +01:00
parent a80a8c66c7
commit 8852867f6e

View file

@ -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