// service/src/main/java/com/gxa/service/systemui/mvvm/service/NetworkService.kt private fun notifyWifiList(){ val results = wifiManager.scanResults // 主线程获取配置文件 val configurations: List<WifiConfiguration> = wifiManager.getConfiguredNetworks()
val ipAddress: Int = wifiManager.getConnectionInfo().getIpAddress()
// 遍历配置文件 results.forEach { ...... }
继续看日志
1 2 3
InputDispatcher( 1018): Application is not responding: Window{e8e7ceb u0 gaei_fullscreen}. It has been 5003.1ms since event, 5002.8ms since wait started. Reason: Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 2. Wait queue head age: 5656.0ms.
I/WindowManager( 1018): Input event dispatching timed out sending to gaei_fullscreen. Reason: Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 2. Wait queue head age: 5656.0ms.
这里也印证了主线程在getConfiguredNetworks()阻塞了。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
01-1312:52:45.392 E/ActivityManager( 1018): ANR in com.gxa.service.systemui 01-1312:52:45.392 E/ActivityManager( 1018): PID: 1709 01-1312:52:45.392 E/ActivityManager( 1018): Reason: Input dispatching timed out(Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 2. Wait queue head age: 5656.0ms.) 01-13 12:52:45.392 E/ActivityManager( 1018): Load: 0.0 / 0.0 / 0.0 01-13 12:52:45.392 E/ActivityManager( 1018): CPU usage from 82769ms to 0ms ago(2022-01-1312:51:22.335 to 2022-01-1312:52:45.105): 01-13 12:52:45.392 E/ActivityManager( 1018): 19% 2506/com.iflytek.cutefly.speechclient.hmi: 18% user + 1% kernel / faults: 6725 minor 01-13 12:52:45.392 E/ActivityManager( 1018): 9.5% 514/surfaceflinger: 5% user + 4.4% kernel / faults: 3943 minor 01-13 12:52:45.392 E/ActivityManager( 1018): 5.4% 2877/com.gxatek.cockpit.launcher: 4% user + 1.3% kernel / faults: 32226 minor 01-13 12:52:45.392 E/ActivityManager( 1018): 4.8% 508/audioserver: 3.4% user + 1.4% kernel / faults: 107 minor 01-13 12:52:45.392 E/ActivityManager( 1018): 3.7% 467/android.hardware.audio@2.0-service.rbxc: 2.6% user + 1% kernel / faults: 111 minor 01-13 12:52:45.392 E/ActivityManager( 1018): 3.6% 516/vendor.bosch.hardware.receiverbasesoftware@1.0-service: 2.2% user + 1.3% kernel / faults: 13044 minor 01-13 12:52:45.392 E/ActivityManager( 1018): 3.3% 479/android.hardware.graphics.composer@2.2-service: 1.7% user + 1.6% kernel / faults: 19 minor 01-13 12:52:45.392 E/ActivityManager( 1018): 2.7% 1018/system_server: 1.3% user + 1.4% kernel / faults: 1816 minor 01-13 12:52:45.392 E/ActivityManager( 1018): 2.2% 482/android.hardware.sensors@1.0-service: 0.5% user + 1.7% kernel // 当时的CPU并不繁忙 01-13 12:52:45.392 E/ActivityManager( 1018): 1.4% 1709/com.gxa.service.systemui: 1% user + 0.3% kernel / faults: 11016 minor
Line 34303: 01-1312:52:45.392 I/ActivityManager( 1018): Killing 1709:com.gxa.service.systemui/1000 (adj -800): bg anr Line 34304: 01-1312:52:45.393 W/libprocessgroup( 1018): kill(-1709, 9) failed: No such process Line 34316: 01-1312:52:45.440 W/libprocessgroup( 1018): kill(-1709, 9) failed: No such process Line 34317: 01-1312:52:45.440 I/libprocessgroup( 1018): Successfully killed process cgroup uid 1000 pid 1709 in 47ms