我在哪里可以找到 JobScheduler 调试文档
Where I can find JobScheduler debug documentation
我有以下调试数据:
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
没有任何文档解释这是什么意思吗?
看到以下内容post,但仅代表个人意见:
Unique periodic work stop executing after a while
您可以像 setRequiresCharging. If constraints not met, Job can be stopped with onStopJob 一样为 Job 指定约束。例如转储中的作业需要 CONNECTIVITY CONTENT_TRIGGER
约束。
Unsatisfied constraints: WITHIN_QUOTA
显示 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 配额。
我有以下调试数据:
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
没有任何文档解释这是什么意思吗?
看到以下内容post,但仅代表个人意见:
Unique periodic work stop executing after a while
您可以像 setRequiresCharging. If constraints not met, Job can be stopped with onStopJob 一样为 Job 指定约束。例如转储中的作业需要 CONNECTIVITY CONTENT_TRIGGER
约束。
Unsatisfied constraints: WITHIN_QUOTA
显示 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 配额。