ANR超时时间在ActivityManagerService.Java文件中进行了定义
1.broadcast超时时间为10秒
-
- static final int BROADCAST_FG_TIMEOUT = 10*1000;
- static final int BROADCAST_BG_TIMEOUT = 60*1000;
2.按键无响应的超时时间为5秒
-
- static final int KEY_DISPATCHING_TIMEOUT = 5*1000;
- <pre code_snippet_id="2232447" snippet_file_name="blog_20170228_4_7356613" class="java" name="code"><pre code_snippet_id="2232447" snippet_file_name="blog_20170228_4_7356613" style="margin-top: 0px; margin-bottom: 0px; background-color: rgb(255, 255, 255); border: 0px;font-size:14px;"></pre></pre>
-
- static final int INSTRUMENTATION_KEY_DISPATCHING_TIMEOUT = 60*1000;
3.service ANR超时的定义在ActiveServices.java中
前台service无响应的超时时间为20秒,后台service为200秒
-
- static final int SERVICE_TIMEOUT = 20*1000;
-
-
- static final int SERVICE_BACKGROUND_TIMEOUT = SERVICE_TIMEOUT * 10;