登录 注册
当前位置:主页 > 资源下载 > 50 > android 6.0 连wifi有感叹号,提示已连接WiFi无法连接网络.doc下载

android 6.0 连wifi有感叹号,提示已连接WiFi无法连接网络.doc下载

  • 更新:2024-06-21 23:52:08
  • 大小:22KB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Android - 移动开发
  • 格式:DOC

资源介绍

framework-base diff --git a/services/core/java/com/android/server/connectivity/NetworkMonitor.java b/services/core/java/com/android/server/connectivity/NetworkMonitor.java index 35e80ca..06a07c2 100755 --- a/services/core/java/com/android/server/connectivity/NetworkMonitor.java +++ b/services/core/java/com/android/server/connectivity/NetworkMonitor.java @@ -671,7 +671,7 @@ public class NetworkMonitor extends StateMachine { HttpURLConnection urlConnection = null; int httpResponseCode = 599; try { - URL url = new URL("http", mServer, "/generate_204"); + URL url = new URL("http", "www.baidu.com", "/more/index.html"); // On networks with a PAC instead of fetching a URL that should result in a 204 // reponse, we instead simply fetch the PAC script. This is done for a few reasons: // 1. At present our PAC code does not yet handle multiple PACs on multiple networks @@ -730,6 +730,11 @@ public class NetworkMonitor extends StateMachine { // There's no point in considering this a captive portal as the user cannot // sign-in to an empty page. Probably the result of a broken transparent proxy. // See http://b/9972012. + if (httpResponseCode == 200) { + if (DBG) log("www.baidu.com 200 response interpreted as 204 response."); + httpResponseCode = 204; + } + if (httpResponseCode == 200 && urlConnection.getContentLength() == 0) { if (DBG) log("Empty 200 response interpreted as 204 response."); httpResponseCode = 204;