Android 6.0 wifi一个LOST_PROVISIONING断开连接的问题

Android6.0系统设置wifi修改保持连接了,但是偶尔会断开连接。查看log,发现如下内容:

04-09 15:09:27.569  2181 22861 D NetlinkSocketObserver: NeighborEvent{elapsedMs=2512360, 192.168.1.1, [(null)], RTM_NEWNEIGH, NUD_FAILED}
04-09 15:09:27.569  2181 22861 W NetlinkSocketObserver: ALERT: NeighborEvent{elapsedMs=2512360, 192.168.1.1, [(null)], RTM_NEWNEIGH, NUD_FAILED}
04-09 15:09:27.569  2181 22861 W IpReachabilityMonitor: FAILURE: LOST_PROVISIONING, NeighborEvent{elapsedMs=2512360, 192.168.1.1, [(null)], RTM_NEWNEIGH, NUD_FAILED}
04-09 15:09:27.584  2181  2784 D IpReachabilityMonitor: clear: iface{wlan0/9}, v{4}, ntable=[]
04-09 15:09:27.593  2947  2947 I wpa_supplicant: wlan0: CTRL-EVENT-DISCONNECTED bssid=d0:c7:c0:d3:a0:e6 reason=3 locally_generated=1

04-09 15:09:27.598  2181  2784 D WifiStateMachine: WifiStateMachine: Leaving Connected state

Adnroid6.0以上系统存在Android- IP LOST_PROVISIONING 的机制

可以在android\frameworks\opt\net\wifi\service\java\com\android\server\wifi\WifiStateMachine.java中屏蔽mIpReachabilityMonitor来解决。

            mIpReachabilityMonitor = null;
/*try {
                mIpReachabilityMonitor = new IpReachabilityMonitor(
                        mContext,
                        mInterfaceName,
                        new IpReachabilityMonitor.Callback() {
                            @Override
                            public void notifyLost(InetAddress ip, String logMsg) {
                                sendMessage(CMD_IP_REACHABILITY_LOST, logMsg);
                            }
                        });
            } catch (IllegalArgumentException e) {
                Log.wtf("Failed to create IpReachabilityMonitor", e);
            }*/


--------------------- 
作者:qq503393230 
来源:CSDN 
原文:https://blog.csdn.net/qq503393230/article/details/79894464 
版权声明:本文为博主原创文章,转载请附上博文链接!