Commit a299021a authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Don't log & update network reachability on Android in capabilities changed callback for WIFI

parent bf92e76b
......@@ -96,8 +96,13 @@ public class NetworkManagerAbove21 implements NetworkManagerInterface {
Log.e("[Platform Helper] [Network Manager 21] onCapabilitiesChanged called with null networkCapabilities, skipping...");
return;
}
Log.i("[Platform Helper] [Network Manager 21] onCapabilitiesChanged " + networkCapabilities.toString());
mHelper.updateNetworkReachability();
if (networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
// This callback can be called very often when on WIFI (for example on signal strenght change), so don't log it each time and no need to update network reachability
Log.d("[Platform Helper] [Network Manager 21] onCapabilitiesChanged " + networkCapabilities.toString());
} else {
Log.i("[Platform Helper] [Network Manager 21] onCapabilitiesChanged " + networkCapabilities.toString());
mHelper.updateNetworkReachability();
}
}
});
}
......
......@@ -96,8 +96,13 @@ public class NetworkManagerAbove23 implements NetworkManagerInterface {
Log.e("[Platform Helper] [Network Manager 23] onCapabilitiesChanged called with null networkCapabilities, skipping...");
return;
}
Log.i("[Platform Helper] [Network Manager 23] onCapabilitiesChanged " + networkCapabilities.toString());
mHelper.updateNetworkReachability();
if (networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
// This callback can be called very often when on WIFI (for example on signal strenght change), so don't log it each time and no need to update network reachability
Log.d("[Platform Helper] [Network Manager 23] onCapabilitiesChanged " + networkCapabilities.toString());
} else {
Log.i("[Platform Helper] [Network Manager 23] onCapabilitiesChanged " + networkCapabilities.toString());
mHelper.updateNetworkReachability();
}
}
});
}
......
......@@ -99,8 +99,14 @@ public class NetworkManagerAbove24 implements NetworkManagerInterface {
Log.e("[Platform Helper] [Network Manager 24] onCapabilitiesChanged called with null networkCapabilities, skipping...");
return;
}
Log.i("[Platform Helper] [Network Manager 24] onCapabilitiesChanged " + networkCapabilities.toString());
mHelper.updateNetworkReachability();
if (networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
// This callback can be called very often when on WIFI (for example on signal strenght change), so don't log it each time and no need to update network reachability
Log.d("[Platform Helper] [Network Manager 24] onCapabilitiesChanged " + networkCapabilities.toString());
} else {
Log.i("[Platform Helper] [Network Manager 24] onCapabilitiesChanged " + networkCapabilities.toString());
mHelper.updateNetworkReachability();
}
}
});
}
......
......@@ -86,8 +86,13 @@ public class NetworkManagerAbove26 implements NetworkManagerInterface {
Log.e("[Platform Helper] [Network Manager 26] onCapabilitiesChanged called with null networkCapabilities, skipping...");
return;
}
Log.i("[Platform Helper] [Network Manager 26] onCapabilitiesChanged " + networkCapabilities.toString());
mHelper.updateNetworkReachability();
if (networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
// This callback can be called very often when on WIFI (for example on signal strenght change), so don't log it each time and no need to update network reachability
Log.d("[Platform Helper] [Network Manager 26] onCapabilitiesChanged " + networkCapabilities.toString());
} else {
Log.i("[Platform Helper] [Network Manager 26] onCapabilitiesChanged " + networkCapabilities.toString());
mHelper.updateNetworkReachability();
}
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment