ANR超时时间的定义

ANR超时时间在ActivityManagerService.Java文件中进行了定义    

[java]  view plain  copy
  1.   

1.broadcast超时时间为10秒

[java]  view plain  copy
  1.     // How long we allow a receiver to run before giving up on it.  
  2.     static final int BROADCAST_FG_TIMEOUT = 10*1000;  
  3.     static final int BROADCAST_BG_TIMEOUT = 60*1000;  

 

2.按键无响应的超时时间为5秒

[java]  view plain  copy
  1. // How long we wait until we timeout on key dispatching.  
  2. static final int KEY_DISPATCHING_TIMEOUT = 5*1000;  
[java]  view plain  copy
  1. <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>  


[java]  view plain  copy
  1. // How long we wait until we timeout on key dispatching during instrumentation.  
  2.  static final int INSTRUMENTATION_KEY_DISPATCHING_TIMEOUT = 60*1000;  

3.service ANR超时的定义在ActiveServices.java中

前台service无响应的超时时间为20秒,后台service为200秒

[java]  view plain  copy
  1.      // How long we wait for a service to finish executing.  
  2.     static final int SERVICE_TIMEOUT = 20*1000;  
  3.   
  4.     // How long we wait for a service to finish executing.  
  5.     static final int SERVICE_BACKGROUND_TIMEOUT = SERVICE_TIMEOUT * 10;  
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值