ANR 默认时间修改

1. input 时间修改:

android/frameworks/native/libs/input/android/os/IInputConstants.aidl

20  /** @hide */
21  interface IInputConstants
22  {
23      // This should be multiplied by the value of the system property ro.hw_timeout_multiplier before
24      // use. A pre-multiplied constant is available in Java in
25      // android.os.InputConstants.DEFAULT_DISPATCHING_TIMEOUT_MILLIS.
26      const int UNMULTIPLIED_DEFAULT_DISPATCHING_TIMEOUT_MILLIS = 10000; // 10 seconds

 2. Broadcast时间修改:

android/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

      // How long we allow a receiver to run before giving up on it.
      static final int BROADCAST_FG_TIMEOUT = 25 * 1000 * Build.HW_TIMEOUT_MULTIPLIER;

      static final int BROADCAST_BG_TIMEOUT = 60 * 1000 * Build.HW_TIMEOUT_MULTIPLIER;

3. ServiceTimeOut 时间修改:

android/frameworks/base/services/core/java/com/android/server/am/ActiveServices.java 

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

 4. provider timeout 时间:

android/frameworks/base/core/java/android/content/ContentResolver.java

      public static final int CONTENT_PROVIDER_PUBLISH_TIMEOUT_MILLIS =
              10 * 1000 * Build.HW_TIMEOUT_MULTIPLIER;
  
      /**
       * How long we wait for an provider to be published. Should be longer than
       * {@link #CONTENT_PROVIDER_PUBLISH_TIMEOUT_MILLIS}.
       * @hide
       */
      public static final int CONTENT_PROVIDER_READY_TIMEOUT_MILLIS =
              CONTENT_PROVIDER_PUBLISH_TIMEOUT_MILLIS + 10 * 1000 * Build.HW_TIMEOUT_MULTIPLIER;
  
      // Timeout given a ContentProvider that has already been started and connected to.
      private static final int CONTENT_PROVIDER_TIMEOUT_MILLIS =
              3 * 1000 * Build.HW_TIMEOUT_MULTIPLIER;
  
      // Should be >= {@link #CONTENT_PROVIDER_WAIT_TIMEOUT_MILLIS}, because that's how
      // long ActivityManagerService is giving a content provider to get published if a new process
      // needs to be started for that.
      private static final int REMOTE_CONTENT_PROVIDER_TIMEOUT_MILLIS =
              CONTENT_PROVIDER_READY_TIMEOUT_MILLIS + CONTENT_PROVIDER_TIMEOUT_MILLIS;

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值