admin管理员组

文章数量:1534194

一、ANR类型

ANR,即“Application not responding”,在Android中,ManagerService会检测应用的响应时间,如果在约定时间内没有完成,那么系统就会判定应用ANR。

1、输入超时

05-28 11:25:00.420 ?1668 ?1713 E ActivityManager: PID: 23293
05-28 11:25:00.420 ?1668 ?1713 E ActivityManager: 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.)

我们可以看到,当ANR类型是由输入超时引发时,我们通过日志可以检索到Input dispatching timed out,Android系统对输入的约定一般时前台8s,后台8s,但对于原生应用,可能会被限制在4-5s内

2、广播超时
广播根据Foreground类型,分为前台10s,后台60s,这里需要注意时间,后续分析日志信息的时候,我们需要根据这个信息去在对应的时间区间内寻找日志信息

Subject : broadcast of Intent/BROADCAST_TIMEOUT_MSG(xxxxxxxxxxxx)

3、Service超时

同样,Service超时也根据Foreground的类型分为前台10s,后台20s,其作用类似

下面展示一些

本文标签: ANR