Merge "Remove logic from NetworkMonitorManager wrapper"

This commit is contained in:
Remi NGUYEN VAN 2022-06-01 01:20:03 +00:00 • committed by Gerrit Code Review
commit de9818fb81

View file

@ -9251,7 +9251,18 @@ public class ConnectivityService extends IConnectivityManager.Stub
params.networkCapabilities = networkAgent.networkCapabilities;
params.linkProperties = new LinkProperties(networkAgent.linkProperties,
true /* parcelSensitiveFields */);
networkAgent.networkMonitor().notifyNetworkConnected(params);
// isAtLeastT() is conservative here, as recent versions of NetworkStack support the
// newer callback even before T. However getInterfaceVersion is a synchronized binder
// call that would cause a Log.wtf to be emitted from the system_server process, and
// in the absence of a satisfactory, scalable solution which follows an easy/standard
// process to check the interface version, just use an SDK check. NetworkStack will
// always be new enough when running on T+.
if (SdkLevel.isAtLeastT()) {
networkAgent.networkMonitor().notifyNetworkConnected(params);
} else {
networkAgent.networkMonitor().notifyNetworkConnected(params.linkProperties,
params.networkCapabilities);
}
scheduleUnvalidatedPrompt(networkAgent);
// Whether a particular NetworkRequest listen should cause signal strength thresholds to