如何更改AOSP源代码中的应用程序无响应(ANR)超时?默认超时为5秒,但该设置在哪里以及如何更改?
答案 0 :(得分:7)
ANR Timeout在File InputDispatcher.cpp(frameworks \ base \ libs \ ui)中定义。复制并粘贴下面的那段代码。
// 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