gpt4 book ai didi

android - 我的服务总是等待 : ServiceRecord error in Kitkat 足够长的时间

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:41:59 25 4
gpt4 key购买 nike

我有一个在 kitkat 中运行的后台服务,它总是在 logcat 中抛出 Waited long enough for: ServiceRecord 消息。但在以前的 android 版本中,我的应用程序运行顺利,没有任何问题。

有时我的服务会在 Kitkat 中自动终止。

最佳答案

这是由于 ActivityServices 的“后台服务序列化运行”修改引起的。

Implement #10744011: Serialize running of background services Added some code to the activity manager to keep track of services that are launching and limit the number that can be launched concurrently. This only comes into play under specific circumstances: when the service launch is a background request (so timing is not important) and its process is not already running at a high priority.

In this case, we have a list of services that are currently launching and when that gets too big we start delaying the launch of future services until currently launching ones are finished.

There are some important tuning parameters for this: how many background services we allow to launch concurrently (currently 1 on low-ram devices, 3 on other devices), and how long we wait for a background service to run before consider it to be a more long-running service and go on to the next pending launch (currently set to 15 seconds).

https://github.com/android/platform_frameworks_base/commit/9210bc85545f31973c957b5179e6a82d05f473c6

关于android - 我的服务总是等待 : ServiceRecord error in Kitkat 足够长的时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21512469/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com