用monkey跑出来的anr问题。模块为音乐。
// NOT RESPONDING: com.android.music (pid 4081)
ANR in com.android.music (com.android.music/.TrackBrowserActivity)
PID: 4081
Reason: Input dispatching timed out (Waiting because no window has focus but there is a focused application that may eventually add a window when it finishes starting up.)
Load: 1.75 / 2.13 / 1.88
CPU usage from 3585ms to -3707ms ago:
12% 619/system_server: 9.6% user + 3.1% kernel / faults: 1350 minor 128 major
0% 160/debuggerd: 0% user + 0% kernel / faults: 2446 minor 101 major
2% 50/ksmd: 0% user + 2% kernel
1.3% 90/mmcqd/0: 0% user + 1.3% kernel
0.8% 721/com.android.systemui: 0.2% user + 0.5% kernel / faults: 184 minor 26 major
0.8% 4081/com.android.music: 0.6% user + 0.1% kernel / faults: 141 minor 17 major
0.6% 162/surfaceflinger: 0.6% user + 0% kernel / faults: 12 minor 20 major
0.6% 864/com.android.phone: 0.4% user + 0.2% kernel / faults: 245 minor 36 major
0.5% 691/com.android.keyguard: 0.2% user + 0.2% kernel / faults: 315 minor 116 major
0% 875/com.marvell.powermeter: 0% user + 0% kernel / faults: 509 minor 109 major
0% 900/com.android.exchange: 0% user + 0% kernel / faults: 503 minor 132 major
0% 911/com.pekall.dm: 0% user + 0% kernel / faults: 493 minor 118 major
0.2% 49/kswapd0: 0% user + 0.2% kernel
0.2% 4288/adbd: 0.1% user + 0.1% kernel
0% 8/rcu_preempt: 0% user + 0% kernel
0% 87/cfinteractive: 0% user + 0% kernel
0.1% 135/logcat: 0% user + 0.1% kernel
0.1% 165/mediaserver: 0.1% user + 0% kernel / faults: 35 minor 102 major
0% 173/phservice: 0% user + 0% kernel / faults: 206 minor 7 major
0% 5213/kworker/0:1: 0% user + 0% kernel
0% 5904/kworker/u9:1: 0% user + 0% kernel
0% 7236/kworker/1:2: 0% user + 0% kernel
7.8% TOTAL: 3.7% user + 2.5% kernel + 1.3% iowait + 0.1% softirq
CPU usage from 3160ms to 3677ms later:
5.6% 619/system_server: 1.8% user + 3.7% kernel
5.6% 634/ActivityManager: 1.8% user + 3.7% kernel
1.9% 50/ksmd: 0% user + 1.9% kernel
0.9% TOTAL: 0% user + 0.9% kernel
// NOT RESPONDING: com.android.music (pid 4081)
ANR in com.android.music (com.android.music/.TrackBrowserActivity)
PID: 4081
Reason: Input dispatching timed out (Waiting because no window has focus but there is a focused application that may eventually add a window when it finishes starting up.)
Load: 1.75 / 2.13 / 1.88
CPU usage from 3585ms to -3707ms ago:
12% 619/system_server: 9.6% user + 3.1% kernel / faults: 1350 minor 128 major
0% 160/debuggerd: 0% user + 0% kernel / faults: 2446 minor 101 major
2% 50/ksmd: 0% user + 2% kernel
1.3% 90/mmcqd/0: 0% user + 1.3% kernel
0.8% 721/com.android.systemui: 0.2% user + 0.5% kernel / faults: 184 minor 26 major
0.8% 4081/com.android.music: 0.6% user + 0.1% kernel / faults: 141 minor 17 major
0.6% 162/surfaceflinger: 0.6% user + 0% kernel / faults: 12 minor 20 major
0.6% 864/com.android.phone: 0.4% user + 0.2% kernel / faults: 245 minor 36 major
0.5% 691/com.android.keyguard: 0.2% user + 0.2% kernel / faults: 315 minor 116 major
0% 875/com.marvell.powermeter: 0% user + 0% kernel / faults: 509 minor 109 major
0% 900/com.android.exchange: 0% user + 0% kernel / faults: 503 minor 132 major
0% 911/com.pekall.dm: 0% user + 0% kernel / faults: 493 minor 118 major
0.2% 49/kswapd0: 0% user + 0.2% kernel
0.2% 4288/adbd: 0.1% user + 0.1% kernel
0% 8/rcu_preempt: 0% user + 0% kernel
0% 87/cfinteractive: 0% user + 0% kernel
0.1% 135/logcat: 0% user + 0.1% kernel
0.1% 165/mediaserver: 0.1% user + 0% kernel / faults: 35 minor 102 major
0% 173/phservice: 0% user + 0% kernel / faults: 206 minor 7 major
0% 5213/kworker/0:1: 0% user + 0% kernel
0% 5904/kworker/u9:1: 0% user + 0% kernel
0% 7236/kworker/1:2: 0% user + 0% kernel
7.8% TOTAL: 3.7% user + 2.5% kernel + 1.3% iowait + 0.1% softirq
CPU usage from 3160ms to 3677ms later:
5.6% 619/system_server: 1.8% user + 3.7% kernel
5.6% 634/ActivityManager: 1.8% user + 3.7% kernel
1.9% 50/ksmd: 0% user + 1.9% kernel
0.9% TOTAL: 0% user + 0.9% kernel
解决方案