7

小米烧 WIFI 问题发生后的一个应急处理办法

 2 years ago
source link: http://i.lckiss.com/?p=7933
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

小米烧 WIFI 问题发生后的一个应急处理办法

2022-03-31

如果像我一样,一时来不及走售后还需要使用的话,会很容易发现续航扛不住,见图(就问我 3 点、6 点 做啥?),上班了才发现已经这么严重:

原因就是系统在一直加载WiFi驱动,失败重试,以及一直尝试使用 WIFI 检测附近的网络信号,用途一般是其他应用请求以及 GPS 辅助定位,截取日志如下:

03-31 10:56:29.444 11216 11878 D PowerCheckerService:   wifiScanTime = 0 ms
03-31 10:56:29.445 11216 11878 D PowerCheckerService:   wifiScanTime = 0 ms
03-31 10:56:29.445 11216 11878 D PowerCheckerService:   wifiScanTime = 0 ms
03-31 10:56:29.445 11216 11878 D PowerCheckerService:   wifiScanTime = 0 ms
03-31 10:56:29.445 11216 11878 D PowerCheckerService:   wifiScanTime = 0 ms
03-31 10:56:29.446 11216 11878 D PowerCheckerService:   wifiScanTime = 0 ms
03-31 10:56:29.446 11216 11878 D PowerCheckerService:   wifiScanTime = 0 ms
03-31 10:57:59.316 15447 15478 D MiuiGallery2_BatchDownloadManager: [work-thread] - condition no wifi
03-31 10:58:20.358  2106  2106 W SettingsProvider: Failed to notify for 999: content://settings/global/wifi_on
03-31 10:58:20.359  5266  7417 D QCNEJ/WlanStaInfoRelay: onChange for uri = content://settings/global/wifi_on
03-31 10:58:21.388  1067  1067 E [email protected]: Failed to access driver state control param No such file or directory, 2: No such file or directory
03-31 10:58:21.389  1067  1067 E [email protected]: Failed to load WiFi driver
03-31 10:58:21.389  1067  1067 E [email protected]: Failed to initialize firmware mode controller
03-31 10:58:21.389  1067  1067 E [email protected]: Wifi HAL start failed
03-31 10:58:21.396  2106  4703 I WifiScanningService: wifi driver unloaded

可以看到这毫秒级的日志打印,不耗电才不正常。

临时解决办法:使用 adb 命令禁用 WIFI,然后不要再手动启用 WIFI,不然即便 WIFI 打不开,其他程序也会认为 WIFI 为开启状态,从而导致上述情况一直无限循环。(需要开发版/ROOT)

1、手机连接电脑,识别到手机后开终端或者 cmd 执行(或者使用手机上的终端软件直接进行第二步也行):

adb shell

2、登入设备后使用 svc 命令禁用 WiFi

svc wifi disable

可以通过 logcat | grep wifi 过滤日志,看到以下提示说明系统认为 WIFI 已经关闭,并且不会再继续进行网络扫描:

03-31 11:03:39.231  2106  4703 I WifiScanningService: wifi driver unloaded
03-31 11:04:59.587 11348 11586 E IDM-CloudCtrFileJob: Current device not connected to wifi.
03-31 11:05:59.608 11348 11586 E IDM-CloudCtrFileJob: Current device not connected to wifi.

PS: 小米 11 是可以支持 USB 转网口 进行网络数据传输的,我在需要时直接用 MBP 的 typc 转网口 hub 测试过了,如果出现无法识别需要先重启手机。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK