在 frameworks/opt/net/ethernet/java/com/android/server/ethernet/EthernetNetworkFactoty.java:
/**
* Manages connectivity for an Ethernet interface.
*
* Ethernet Interfaces may be present at boot time or appear after boot (e.g.,
* for Ethernet adapters connected over USB). This class currently supports
* only one interface. When an interface appears on the system (or is present
* at boot time) this class will start tracking it and bring it up, and will
* attempt to connect when requested. Any other interfaces that subsequently
* appear will be ignored until the tracked interface disappears. Only
* interfaces whose names match the config_ethernet_iface_regex
* regular expression are tracked.
*
* This class reports a static network score of 70 when it is tracking an
* interface and that interface's link is up, and a score of 0 otherwise.
*
* @hide
*/
參考的地方是...
mIfaceMatch = context.getResources().getString(
com.android.internal.R.string.config_ethernet_iface_regex);
...
private boolean maybeTrackInterface(String iface) {
// If we don't already have an interface, and if this interface matches
// our regex, start tracking it.
if (!iface.matches(mIfaceMatch) || isTrackingInterface())
return false;
Log.d(TAG, "Started tracking interface " + iface);
setInterfaceUp(iface);
return true;
}
沒有留言:
張貼留言