android - 在哪里可以找到 JobScheduler 调试文档
问题描述
我从调试中得到以下数据:
JOB #u0a231/5: a2826a0 com.abc.workmanagertest/androidx.work.impl.background.systemjob.SystemJobService
u0a231 tag=*job*/com.abc.workmanagertest/androidx.work.impl.background.systemjob.SystemJobService
Source: uid=u0a231 user=0 pkg=com.abc.workmanagertest
JobInfo:
Service: com.abc.workmanagertest/androidx.work.impl.background.systemjob.SystemJobService
Flags: 2
Requires: charging=false batteryNotLow=false deviceIdle=false
Trigger content URIs:
1 content://media/internal/video/media
1 content://media/external/video/media
1 content://media/internal/images/media
1 content://media/external/images/media
Trigger update delay: +1m0s0ms
Trigger max delay: +10m0s0ms
Extras: mParcelledData.dataSize=180
Network type: NetworkRequest [ NONE id=0, [ Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&VALIDATED Uid: 10231 AdministratorUids: [] RequestorUid: -1 RequestorPackageName: null] ]
Backoff: policy=1 initial=+30s0ms
Required constraints: CONNECTIVITY CONTENT_TRIGGER [0x14000000]
Dynamic constraints:
Satisfied constraints: CONNECTIVITY CONTENT_TRIGGER DEVICE_NOT_DOZING BACKGROUND_NOT_RESTRICTED [0x16400000]
Unsatisfied constraints: WITHIN_QUOTA [0x1000000]
Tracking: CONNECTIVITY CONTENT QUOTA
Implicit constraints:
readyNotDozing: true
readyNotRestrictedInBg: true
readyDynamicSatisfied: false
Network: 103
Standby bucket: RARE
Deferred since: -1h4m36s59ms
Enqueue time: -1h4m36s59ms
Run time: earliest=none, latest=none, original latest=none
Restricted due to: none.
Ready: false (job=false user=true !restricted=true !pending=true !active=true !backingup=true comp=true)
如您所见,未执行作业的问题是:未满足的约束:WITHIN_QUOTA
没有任何文档解释这意味着什么吗?
我看到了以下帖子,但这只是一个观点:
解决方案
您可以像setRequiresCharging一样为 Job 指定约束。如果不满足约束,可以使用onStopJob停止作业。例如,转储中的作业需要CONNECTIVITY CONTENT_TRIGGER
约束。
Unsatisfied constraints: WITHIN_QUOTA
shows WITHIN_QUOTA implicit constraints unsatisfied for this job - can't run your job without quota. WITHIN_QUOTA
is implicit constraints (added without explicit constraints setting, see this code).
PTAL QuotaController
documentation for more detail regards standby bucket quota.
推荐阅读
- android - Recycler View 在 portraint 中显示数据,但在横向中不显示数据,即使我在方向更改后再次设置它
- google-sheets - 谷歌表格 SumProduct 反向
- javascript - 使用 webpack 的 ProvidePlugin 时,jQuery 不能作为“$”使用
- angular - How do i load dynamic scripts in angular
- jenkins - Jenkins Exclude Regions with Git 需要工作区(不必要地触发构建)
- java - 会议室无法检索以下列
- reporting-services - 导出的 PDF 中缺少子报表的分页符
- java - 在 JavaFX 中为不同的场景重用相同的按钮
- azure - 从 Powershell 获取实际 Azure Function 端点列表
- java - 如何检查字符串是否在 ANTLR 上下文中匹配?