首页 > 解决方案 > jobScheduler 节流规范 Android 11 (api 30)

问题描述

我正在开发一个严重依赖 jobScheduler 在后台执行多个任务的应用程序。从下一个 api 版本(android11、api 30)开始,文档(以及开发者预览版中)指出:

JobScheduler will throttle runaway applications. Calling schedule(android.app.job.JobInfo) and other such methods with very high frequency is indicative of an app bug and so, to make sure the system doesn't get overwhelmed, JobScheduler will begin to throttle apps that show buggy behavior, regardless of target SDK version.

但我找不到任何关于什么是“正常”使用 jobScheduler 的规范。

我尝试查找源代码,但在 AOSP 下找不到 android11 分支,并且在build-numbers列表下没有提及。

他们确实提供了一个模拟器版本来执行测试,但我更喜欢知道我的界限(而不是为了弄清楚这些数字是什么而执行一系列测试)。

如果有人能指出功能规范或 android11 源代码,我将不胜感激。

标签: android-sourceandroid-jobschedulerandroid-11

解决方案


推荐阅读