Android ANR超时时间的定义

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

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;

按键无响应的超时时间为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;

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;

版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/11/definition-of-android-anr-timeout-time/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
Android ANR超时时间的定义
ANR超时时间在ActivityManagerService.java文件中进行了定义 Broadcast超时时间为10秒 // How long we allow a receiver to run before giving up on it. sta……
<<上一篇
下一篇>>
文章目录
关闭
目 录