admin管理员组

文章数量:1546483

文章目录

    • 开发平台基本信息
    • 问题描述
    • 问题分析
    • 解决方法

开发平台基本信息

芯片: SDM450
版本: Android 9.0
kernel: msm-4.9

问题描述

前段时间,有个医院的客户反馈我们的设备无法连接上他们医院路由器的WIFI,并且设备显示wifi已保存,但就是连接不上。而且,连接手机的热点却是能正常连接并且能够上网的。

问题分析

  1. 首先,基本可以排除硬件问题,因为能够连接手机热点并且能够上网;
  2. 其次,因为显示已保存,所以猜想会不会是WIFI的状态是保存了,但是,实际上WIFI的密码等参数没有写到本地文件,但是,客户忘记WIFI密码、恢复出厂设置,也都无法连接。
  3. 硬件跟软件操作流程都没问题,那就只能对比WIFI的差异性了,让客户把机器的WIFI信息保存的文件导出来,对比一下路由WIFI跟热点有什么区别。

注:WIFI信息保存的路径:/data/misc/wifi/WifiConfigStore.xml

从上图,可以看出来热点的加密方式是WPA_PSK;而路由器WIFI的加密方式是SAE;所以,猜想是不是我们的设备不支持SAE加密方式WIFI。果然,移植相关补丁之后,客户反馈能够正常连接他们的WIFI了,下面给出具体的补丁。

解决方法

路径:frameworks/base/

diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 5bbfcee..c9655a5 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -673,6 +673,8 @@
     <!-- Wifi driver supports IEEE80211AC for softap -->
     <bool translatable="false" name="config_wifi_softap_ieee80211ac_supported">false</bool>
 
+    <bool translatable="false" name="config_wifi_wpa3_supported">false</bool>
+
     <!-- Flag indicating whether we should enable the automatic brightness.
          Software implementation will be used if config_hardware_auto_brightness_available is not set -->
     <bool name="config_automatic_brightness_available">false</bool>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 4a40131..6aa7750 100755
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -319,6 +319,7 @@
   <java-symbol type="bool" name="config_wifi_batched_scan_supported" />
   <java-symbol type="bool" name="config_wifi_softap_acs_supported" />
   <java-symbol type="bool" name="config_wifi_softap_ieee80211ac_supported" />
+  <java-symbol type="bool" name="config_wifi_wpa3_supported" />
   <java-symbol type="bool" name="config_enableMultiUserUI"/>
   <java-symbol type="bool" name="config_enableNewAutoSelectNetworkUI"/>
   <java-symbol type="bool" name="config_disableUsbPermissionDialogs"/>
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
index 2e85014..2126719 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
@@ -140,6 +140,7 @@ public class AccessPoint implements Comparable<AccessPoint> {
   
      */
     private final Map<String, TimestampedScoredNetwork> mScoredNetworkCache = new HashMap<>();
 
+    private boolean apSupportsSaeAndPsk;
     static final String KEY_NETWORKINFO = "key_networkinfo";
     static final String KEY_WIFIINFO = "key_wifiinfo";
     static final String KEY_SSID = "key_ssid";
@@ -313,6 +314,15 @@ public class AccessPoint implements Comparable<AccessPoint> {
   
         ssid = firstResult.SSID;
         bssid = firstResult.BSSID;
         security = getSecurity(firstResult);
+        apSupportsSaeAndPsk = checkForSaeAndPsk(firstResult);
+        if (apSupportsSaeAndPsk) {
   
+            boolean wpa3Support = mContext.getResources().getBoolean(
+                    com.android.internal.R.bool.config_wifi_wpa3_supported);
+            Log.e(TAG, "wpa3Support: " + wpa3Support);
+            if (!wpa3Support)
+                security 

本文标签: 高通协议设备wifiSAE