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;
发布了270 篇原创文章 · 获赞 273 · 访问量 377万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览