ANR超时时间的定义

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

1.broadcast超时时间为10秒

    // How long we allow a receiver to run before giving up on it.
    static final int BROADCAST_FG_TIMEOUT = 10*1000;
    static final int BROADCAST_BG_TIMEOUT = 60*1000;

 

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

 // How long we wait until we timeout on key dispatching.
 static final int KEY_DISPATCHING_TIMEOUT = 5*1000;


// How long we wait until we timeout on key dispatching during instrumentation.
 static final int INSTRUMENTATION_KEY_DISPATCHING_TIMEOUT = 60*1000;

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

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

     // How long we wait for a service to finish executing.
    static final int SERVICE_TIMEOUT = 20*1000;

    // How long we wait for a service to finish executing.
    static final int SERVICE_BACKGROUND_TIMEOUT = SERVICE_TIMEOUT * 10;
©️2020 CSDN 皮肤主题: 大白 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值