问题描述
P版本CTS_multinetwork connectivity test失败
解决方案
问题分析:
检查sys_log,搜索ConnectivityService.java查看wifi分数
1.wifi分数100,查看acceptUnvalidated是否是true,若是查看wifi逻辑
11-12 21:35:41.997 1350 1487 D MtkConnectivityService: Switching to new default network: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED Unwanted: LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps SignalStrength: -24 SSID: "Realme 1"]} Score{100} everValidated{false} lastValidated{false} created{true} lingering{false} explicitlySelected{true} acceptUnvalidated{true} everCaptivePortalDetected{false} lastCaptivePortalDetected{false} clat{null} }
2.wifi分数为60或100,acceptUnvalidated为false,且everValidated和lastValidated也为false
12-04 05:06:37.313366 1024 1164 D MtkConnectivityService: registerNetworkAgent NetworkAgentInfo{ ni{[type: WIFI[], state: CONNECTING/CONNECTING, reason: (unspecified), Score{60} everValidated{false} lastValidated{false} created{false} lingering{false} explicitlySelected{false} acceptUnvalidated{false} everCaptivePortalDetected{false} lastCaptivePortalDetected{false} clat{null} }
1.查看wifi初始分数是否为60 WIFI_BASE_SCORE = 60,若不是修改为60
2.查看UNVALIDATED_SCORE_PENALTY的值是否为40,若不是修改为40