如何在AOSP中更改应用程序无响应(ANR)超时 [英] How to change Application Not Responding (ANR) Timeout in AOSP

查看:114
本文介绍了如何在AOSP中更改应用程序无响应(ANR)超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改AOSP源代码中的应用程序无响应(ANR)超时?默认超时为5秒,但是该设置在哪里以及如何更改?

How do I change the Application Not Responding (ANR) timeout in the AOSP source code? The default timeout is 5 seconds, but where is that set and how do I change it?

推荐答案

ANR超时在文件InputDispatcher.cpp(frameworks \ base \ libs \ ui)中定义.在下面复制并粘贴这段代码.

The ANR Timeout is defined in File InputDispatcher.cpp (frameworks\base\libs\ui) . Copying and pasting that piece of code below.

// Default input dispatching timeout if there is no focused application or paused window
// from which to determine an appropriate dispatching timeout.
const nsecs_t DEFAULT_INPUT_DISPATCHING_TIMEOUT = 5000 * 1000000LL; // 5 sec

这篇关于如何在AOSP中更改应用程序无响应(ANR)超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆