|
(以太网)默认启用静态IP
发表于 2016-5-24 17:33:12
浏览:15139
|
回复:13
打印
只看该作者
[复制链接]
楼主
本帖最后由 风之空响 于 2016-5-25 10:13 编辑
1.frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
private void loadSystemSettings(SQLiteDatabase db) { 下增加:
/ 增加默认静态IP 端口,子网掩码等设置
loadBooleanSetting(stmt, Settings.System.ETHERNET_USE_STATIC_IP,
R.bool.def_ethernet_use_static_ip);//默认启用静态IP
loadStringSetting(stmt, Settings.System.ETHERNET_STATIC_IP,
R.string.def_ethernet_static_ip);
loadStringSetting(stmt, Settings.System.ETHERNET_STATIC_GATEWAY,
R.string.def_ethernet_static_gateway);
loadStringSetting(stmt, Settings.System.ETHERNET_STATIC_NETMASK,
R.string.def_ethernet_static_netmask);
loadStringSetting(stmt, Settings.System.ETHERNET_STATIC_DNS1,
R.string.def_ethernet_static_dns1);2. frameworks/base/packages/SettingsProvider/res/values/defaults.xml
<!--luyq add Default for static IP port,gateway dns-->
<bool name="def_ethernet_on">true</bool>
<bool name="def_ethernet_use_static_ip">true</bool>
<string name="def_ethernet_static_ip">192.168.1.102</string>
<string name="def_ethernet_static_gateway">192.168.1.101</string>
<string name="def_ethernet_static_netmask">255.255.255.0</string>
<string name="def_ethernet_static_dns1">192.168.1.101</string>
<string name="def_ethernet_static_dns2">8.8.8.8</string>
3.如果时5.1.1的话,由于sdk的问题,通过Settings.System.ETHERNET_USE_STATIC_IP默认启用静态ip无效,
目前Bug已修复,在修复后的sdk没推送出去前,如果想要默认启用静态ip的话,可以打上如下补丁
0001-Settings.System.ETHERNET_USE_STATIC_IP-ip 3128-5.1补丁
0001-Settings.System.ETHERNET_USE_STATIC_IP-ip.patch.tar.gz
(1.89 KB, 下载次数: 37)
3288-5.1_0001-Android-Eth-Settings.System.ETHERNET_USE_STATIC_IP-i.patch 3288-5.1补丁
|
|