EthernetConfigStore 中存储的信息,EthernetConfigStore 中通过读取 /misc/ethernet/ipconfig.txt 获取interfaceConfigs 的信息,在 EthernetTracker 的构造方法中通过解析 config_ethernet_interfaces 字符串也可向 Map 中添加初始信息。 EthernetTracker(
-- Configuration of Ethernet interfaces in the following format:<interface name|mac address>;[Network Capabilities];[IP config]Where[Network Capabilities] Optional. A comma seprated list of network capabilities.Values must be from NetworkCapabilities#NET_CAPABILITIES_* constants.[IP config] Optional. I...
com.android.internal.R.string.config_ethernet_iface_regex); // Read default Ethernet interface configuration from resources final String[] interfaceConfigs = context.getResources().getStringArray( com.android.internal.R.array.config_ethernet_interfaces); for (String strConfig : interfaceConfigs) { pa...
* Tracks Ethernet interfaces and manages interface configurations. * * Interfaces may have different {@link android.net.NetworkCapabilities}. This mApping is defined * in {@code config_ethernet_interfaces}. Notably, some interfaces could be marked as restricted by * not specifying {@link android.ne...
<!-- Regex of wired ethernet ifaces --> - <stringtranslatable="false"name="config_ethernet_iface_regex">eth\\d</string> + <stringtranslatable="false"name="config_ethernet_iface_regex">eth\\d|usb\\d</string> <!-- Configuration of Ethernet interfacesinthe following format:<interfacename|ma...
增加设置项 packages\apps\Settings\res\xml\ethernet_settings.xml 增加一个 ListPreference用来显示多个网卡节点 2. 修改源码 packages\apps\Settings\src\com\android\settings\ethernet\EthernetSettings.java 增加一个Preference Key onCreate里增加代码 onResume增加代码 ...
hasInterface(iface)) { - return; + return false; } if (mIpConfigForDefaultInterface != null) { @@ -266,13 +297,31 @@ final class EthernetTracker { } addInterface(iface); + return true; } private void trackAvailableInterfaces() { try { final String[] ifaces = mNMService.list...
问通过编程实现以太网连接(Android) (根设备)EN只有系统应用程序才能获得WRITE_SECURE_SETTINGS权限。该...
{ @@ -521,7 +550,7 @@ public class EthernetTracker { } final String hwAddress = config.hwAddr; - + Settings.System.putString(mContext.getContentResolver(), "sys_tex_hwAddress", hwAddress);//add xx xx NetworkCapabilities nc = mNetworkCapabilities.get(iface); if (nc == null) { // ...
*/ /** {@hide} */ interface IEthernetManager { String[] getAvailableInterfaces(); IpConfiguration getConfiguration(String iface); void setConfiguration(String iface, in IpConfiguration config); boolean isAvailable(String iface); void addListener(in IEthernetServiceListener listener); void remove...