Remove the queue on the NetworkAgent side
Now that the system server has a queue doing this job, the queue on the network agent side can be removed. Test: ConnectivityCoverageTests, CtsNetTestCases Change-Id: Idf0435f447cfdd28d829a867d1085771837c6f9b
This commit is contained in:
parent
6f2b294fd0
commit
391ec5d99c
1 changed files with 197 additions and 79 deletions
|
|
@ -158,6 +158,7 @@ import static com.android.server.connectivity.ConnectivityFlags.DELAY_DESTROY_SO
|
|||
import static com.android.server.connectivity.ConnectivityFlags.INGRESS_TO_VPN_ADDRESS_FILTERING;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.NAMESPACE_TETHERING_BOOT;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.QUEUE_CALLBACKS_FOR_FROZEN_APPS;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.QUEUE_NETWORK_AGENT_EVENTS_IN_SYSTEM_SERVER;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.REQUEST_RESTRICTED_WIFI;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.WIFI_DATA_INACTIVITY_TIMEOUT;
|
||||
|
||||
|
|
@ -9418,10 +9419,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||
if (DBG) log("registerNetworkAgent " + nai);
|
||||
mDeps.getNetworkStack().makeNetworkMonitor(
|
||||
nai.network, name, new NetworkMonitorCallbacks(nai));
|
||||
// NetworkAgentInfo registration will finish when the NetworkMonitor is created.
|
||||
// If the network disconnects or sends any other event before that, messages are deferred by
|
||||
// NetworkAgent until nai.connect(), which will be called when finalizing the
|
||||
// registration. TODO : have NetworkAgentInfo defer them instead.
|
||||
// NetworkAgentInfo registration is done, but CS will only accept messages when the
|
||||
// NetworkMonitor is created. If the network disconnects or sends any other event
|
||||
// before that, messages are deferred by the Tracker Handler until it is (by asking
|
||||
// NetworkAgentInfo to do it). The window is very small unless the NetworkStack
|
||||
// doesn't reply immediately, which would mean a broken system anyway.
|
||||
final NetworkAndAgentRegistryParcelable result = new NetworkAndAgentRegistryParcelable();
|
||||
result.network = nai.network;
|
||||
result.registry = nai.getRegistry();
|
||||
|
|
@ -15048,6 +15050,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||
if (mUseDeclaredMethodsForCallbacksEnabled) {
|
||||
features |= ConnectivityManager.FEATURE_USE_DECLARED_METHODS_FOR_CALLBACKS;
|
||||
}
|
||||
if (mQueueNetworkAgentEventsInSystemServer) {
|
||||
features |= ConnectivityManager.FEATURE_QUEUE_NETWORK_AGENT_EVENTS_IN_SYSTEM_SERVER;
|
||||
}
|
||||
return features;
|
||||
}
|
||||
|
||||
|
|
@ -15056,6 +15061,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||
switch (featureFlag) {
|
||||
case INGRESS_TO_VPN_ADDRESS_FILTERING:
|
||||
return mIngressToVpnAddressFiltering;
|
||||
case QUEUE_NETWORK_AGENT_EVENTS_IN_SYSTEM_SERVER:
|
||||
return mQueueNetworkAgentEventsInSystemServer;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown flag: " + featureFlag);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue