瑞芯微Rockchip开发者社区
直播中

李丹

7年用户 1426经验值
私信 关注
[问答]

怎样去解决RK3188的wifi无法切换4G上网的问题呢

4G无法上网的根本原因是什么导致的?怎样去解决RK3188的wifi无法切换4G上网的问题呢?

回帖(1)

彭丞峥

2022-2-18 11:12:37
之所以4G无法上网的根本原因是4G的ppp拨号没有设置指定路由导致的,只需在rk3188_5.1_midframeworksbaseservicescorejavacomandroidserverConnectivityService.java加入指定路由即可从根本上解决问题
添加4G路由:

for (RouteInfo route : routeDiff.added) {
if (route.hasGateway() == false) continue;
if (DBG) log("Adding Route [" + route + "] to network " + netId);
try {
/**add by shihao for 4G start*/
if (route.getInterface().equals("ppp0")) {
RouteInfo xroute = RouteInfo.makeHostRoute(route.getGateway(),
route.getInterface()); // make host route for nexthop
mNetd.addRoute(netId, xroute); //add nexthop(getGateway()) for table ppp0
if (DBG) log("Adding Route [" + xroute + "] to network " + netId);
}
/**add by shihao for 4G end*/
mNetd.addRoute(netId, route);
} catch (Exception e) {
if ((route.getGateway() instanceof Inet4Address) || VDBG) {
loge("Exception in addRoute for gateway: " + e);
}
}
}
举报

更多回帖

发帖
×
20
完善资料,
赚取积分