Lines Matching defs:network

193     // network sampling debugging
198 // TODO: create better separation between radio types and network types
200 // how long to wait before switching back to a radio's default network
219 // Set network sampling interval at 12 minutes, this way, even if the timers get
224 // start network sampling a minute after booting ...
245 /** Currently active network rules by UID. */
251 * Sometimes we want to refer to the individual network state
285 * network - EVENT_EXPIRE_NET_TRANSITION_WAKELOCK happens
286 * after a timeout if no network is found (typically 1 min).
341 * used to add a network request
347 * indicates a timeout period is over - check if we had a network yet or not
355 * used to add a network listener - no request
361 * used to remove a network request, either a listener or a real request
376 * a new network (typically after 1 minute) -
378 * a replacement network.
424 // the set of network types that can only be enabled by system/sig apps
442 * Implements support for the legacy "one network per network type" model.
445 * network type, but that doesn't work any more now that we can have,
446 * for example, more that one wifi network. This class stores all the
452 * 1. Provide information about "the network for a given type" (since this
455 * the first network for a given type changes, or if the default network
465 * Array of lists, one per legacy network type (e.g., TYPE_MOBILE_MMS).
467 * satisfy requests for that network type.
469 * This array is built out at startup such that an unsupported network
473 * The actual lists are populated when we scan the network types that
511 /** Adds the given network to the specified legacy type list. */
514 return; // Invalid network type.
516 if (VDBG) log("Adding agent " + nai + " for legacy network type " + type);
526 // Send a broadcast if this is the first network of its type or if it's the default.
533 /** Removes the given network from the specified legacy type list. */
552 if (DBG) log("Other network available for type " + type +
559 /** Removes the given network from all legacy type lists. */
645 // ouch, no rules updates means some processes may never get network
771 nai.network = new Network(netId);
801 * Check if UID should be blocked from using the network represented by the given networkType.
809 * Check if UID should be blocked from using the network represented by the given
817 * Check if UID should be blocked from using the network with the given LinkProperties.
833 // no restrictive rules; network is visible
853 // network is blocked; clone and override state
868 // network is blocked; clone and override state
881 * Return NetworkInfo for the active (i.e., connected) network interface.
882 * It is assumed that at most one network is active at a time. If more
884 * @return the info for the active network, or {@code null} if none is
895 * Find the first Provisioning network.
915 * Find the first Provisioning network or the ActiveDefaultNetwork
916 * if there is no Provisioning network
965 public NetworkInfo getNetworkInfoForNetwork(Network network) {
967 if (network == null) return null;
972 nai = mNetworkForNetId.get(network.netId);
1004 return (nai == null) ? null : nai.network;
1013 result.add(new Network(mNetworkForNetId.valueAt(i).network));
1027 * network interface. It is assumed that at most one default network
1030 * @return the ip properties for the active network, or {@code null} if
1049 public LinkProperties getLinkProperties(Network network) {
1053 nai = mNetworkForNetId.get(network.netId);
1065 public NetworkCapabilities getNetworkCapabilities(Network network) {
1069 nai = mNetworkForNetId.get(network.netId);
1158 * Ensure that a network route exists to deliver traffic to the specified
1159 * host via the specified network interface.
1160 * @param networkType the type of the network over which traffic to the
1181 if (DBG) log("requestRouteToHostAddress on invalid network: " + networkType);
1188 if (DBG) log("requestRouteToHostAddress on unsupported network: " + networkType);
1190 if (DBG) log("requestRouteToHostAddress on down network: " + networkType);
1202 log("requestRouteToHostAddress on down network "
1216 netId = nai.network.netId;
1309 // kick off connectivity change broadcast for active network, since
1466 // start network sampling ..
1518 * Setup data activity tracking for the given network.
1557 * Remove data activity tracking when network disconnects.
1575 * Reads the network specific MTU size from reources.
1711 pw.print("Active default network: ");
1715 pw.println(defaultNai.network.netId);
1784 if (nai.network == null) return false;
1787 officialNai = mNetworkForNetId.get(nai.network.netId);
1877 mNetd.addVpnUidRanges(nai.network.netId, (UidRange[])msg.obj);
1891 mNetd.removeVpnUidRanges(nai.network.netId, (UidRange[])msg.obj);
1905 loge("ERROR: created network explicitly selected.");
1926 // Let the NetworkAgent know the state of its network
1976 * for now its an in between network, its a network that
1977 * is actually a default network but we don't want it to be
1986 log("EVENT_STATE_CHANGED: connected to provisioning network, lp=" + lp);
1991 // connection will fail until the provisioning network
2009 // TODO: Temporary allowing network configuration
2027 // A network factory has connected. Send it all current NetworkRequests.
2041 // A network agent has requested a connection. Establish the connection.
2049 mNetworkForNetId.remove(nai.network.netId);
2063 // A network agent has disconnected.
2065 // Tell netd to clean up the configuration for this network
2068 mNetd.removeNetwork(nai.network.netId);
2070 loge("Exception removing network: " + e);
2073 // TODO - if we move the logic to the network agent (have them disconnect
2090 mNetworkForNetId.remove(nai.network.netId);
2092 // Since we've lost the network, go through all the requests that
2099 if (currentNetwork != null && currentNetwork.network.netId == nai.network.netId) {
2101 log("Checking for replacement network to handle request " + request );
2143 // Check for the best currently alive network that satisfies this request
2145 for (NetworkAgentInfo network : mNetworkAgentInfos.values()) {
2146 if (DBG) log("handleRegisterNetworkRequest checking " + network.name());
2147 if (newCap.satisfiedByNetworkCapabilities(network.networkCapabilities)) {
2148 if (DBG) log("apparently satisfied. currentScore=" + network.getCurrentScore());
2150 bestNetwork.getCurrentScore() < network.getCurrentScore()) {
2155 network.addRequest(nri.request);
2156 notifyNetworkCallback(network, nri);
2158 bestNetwork = network;
2166 // Cancel any lingering so the linger timeout doesn't teardown this network
2207 log(" Removing from current network " + nai.name() +
2226 // that a network connected to serve it, even though the network was already
2228 // that the network disconnected. LegacyTypeTracker will generate that
2275 log("Failed to find a new network - expiring NetTransition Wakelock");
2278 " cleared because we found a replacement network");
2461 // Called when we lose the default network and have no replacement yet.
2462 // This will automatically be cleared after X seconds or a new default network
2481 if (percentage > 50) return; // don't handle good network reports
2483 if (nai != null) reportBadNetwork(nai.network);
2486 public void reportBadNetwork(Network network) {
2490 if (network == null) return;
2495 nai = mNetworkForNetId.get(network.netId);
2500 // Validating an uncreated network could result in a call to rematchNetworkAndRequests()
2737 Slog.e(TAG, "Unexpected network type");
2803 throw new IllegalStateException("Missing active network connection");
2966 * Show or hide network provisioning notificaitons.
3265 /* Infrastructure for network sampling */
3314 * Sets a network sampling alarm.
3500 * and the are the highest scored network available.
3548 int netId = networkAgent.network.netId;
3550 // The NetworkAgentInfo does not know whether clatd is running on its network or not. Before
3592 if (DBG) log("Adding iface " + iface + " to network " + netId);
3600 if (DBG) log("Removing iface " + iface + " from network " + netId);
3625 if (DBG) log("Adding Route [" + route + "] to network " + netId);
3636 if (DBG) log("Adding Route [" + route + "] to network " + netId);
3647 if (DBG) log("Removing Route [" + route + "] from network " + netId);
3666 if (DBG) log("Setting Dns servers for network " + netId + " to " + dnses);
3674 if (defaultNai != null && defaultNai.network.netId == netId) {
3742 bundle.putParcelable(Network.class.getSimpleName(), networkAgent.network);
3779 loge("Dead network still had at least " + nr);
3795 if (DBG) log("Switching to new default network: " + newNetwork);
3799 mNetd.setDefaultNetId(newNetwork.network.netId);
3801 loge("Exception setting default network :" + e);
3808 // Handles a network appearing or improving its score.
3815 // needed. A network is needed if it is the best network for
3835 // another higher scoring network by another call to rematchNetworkAndRequests()
3838 if (!newNetwork.created) loge("ERROR: uncreated network being rematched.");
3839 if (nascent && !newNetwork.validated) loge("ERROR: nascent network not validated.");
3844 // which this network is now the best.
3846 if (VDBG) log(" network has: " + newNetwork.networkCapabilities);
3869 // next check if it's better than any current network we're using for
3879 if (DBG) log(" accepting network in place of " + currentNetwork.name());
3884 if (DBG) log(" accepting network in place of null");
3895 // network. Think about if there is a way to reduce this. Push
3910 // understands one network at a time, we must pretend
3911 // that the current default network disconnected before
3944 // but if they transition and old network stays up, don't tell them of linger
3952 // Notify system services that this network is up.
3955 // have a new default network, release the transition wakelock in
3957 // to reconnect over the new network
3967 // Notify battery stats service about this network, both the normal
3969 // TODO: Avoid redoing this; this must only be done once when a network comes online.
3988 // NetworkMonitor reports a bad network and we tear it down then.
3990 // the lingering process so communication on that network is given time to wrap up.
3993 if (DBG) log("Validated network turns out to be unwanted. Tear it down.");
4009 // example in the case where "changed"'s score decreases and another network should begin
4059 if (VDBG) log("ignoring duplicate network state non-change");
4072 mNetd.createVirtualNetwork(networkAgent.network.netId,
4077 mNetd.createPhysicalNetwork(networkAgent.network.netId);
4080 loge("Error creating network " + networkAgent.network.netId + ": "
4098 // TODO: support proxy per network.
4100 // Consider network even though it is not yet validated.
4151 // the state to DISCONNECTED, even though the network is of type MOBILE