1. 无连接网络不断开
android/frameworks/base/services/core/java/com/android/server/ConnectivityService.java
修改: teardownUnneededNetwork去掉nai.asyncChannel.disconnect();
2. 数据网络调整优先级最高
android/frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
修改:DcNetworkAgent优先级从50改为120
android/frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/TelephonyNetworkFactory.java
修改:TELEPHONY_NETWORK_SCORE从50改为80
3. 评分evalRequest默认启动网络,否则先打开数据后,wlan和以太网不会主动连接
android/frameworks/base/core/java/android/net/NetworkFactory.java
android/frameworks/opt/net/ethernet/java/com/android/server/ethernet/EthernetNetworkFactory.java
android/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiStateMachine.java
修改:evalRequest方法
if(persistNetwork()){
log("persistNetwork:");
needNetworkFor(n.request, n.score);
}else
4. wlan和以太网连接后更新路由
android/frameworks/base/services/core/java/com/android/server/ConnectivityService.java
修改:updateLinkProperties,可在init.rc定义服务,使用setprop ctl.start启动
5. 更新路由可修改ip源码,参考ip rule add 和ip rule del
android/external/iproute2/ip/Android.mk
android/external/iproute2/ip/iprule.c