当前位置:   article > 正文

ANR问题基本定位与分析_waiting because no window has focus but activityre

waiting because no window has focus but activityrecord

一、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.)
  • 1
  • 2

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

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

Subject : broadcast of Intent/BROADCAST_TIMEOUT_MSG(xxxxxxxxxxxx)
  • 1

3、Service超时

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

下面展示一些

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/204107
推荐阅读
相关标签
  

闽ICP备14008679号