diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java index f760d3b894..986b108fc0 100644 --- a/service/src/com/android/server/ConnectivityService.java +++ b/service/src/com/android/server/ConnectivityService.java @@ -9252,7 +9252,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