Home
last modified time | relevance | path

Searched refs:jobStatus (Results 1 – 25 of 25) sorted by relevance

/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/controllers/
DConnectivityController.java337 public void maybeStartTrackingJobLocked(JobStatus jobStatus, JobStatus lastJob) { in maybeStartTrackingJobLocked() argument
338 if (jobStatus.hasConnectivityConstraint()) { in maybeStartTrackingJobLocked()
340 getUidStats(jobStatus.getSourceUid(), jobStatus.getSourcePackageName(), false); in maybeStartTrackingJobLocked()
341 if (wouldBeReadyWithConstraintLocked(jobStatus, JobStatus.CONSTRAINT_CONNECTIVITY)) { in maybeStartTrackingJobLocked()
344 ArraySet<JobStatus> jobs = mTrackedJobs.get(jobStatus.getSourceUid()); in maybeStartTrackingJobLocked()
347 mTrackedJobs.put(jobStatus.getSourceUid(), jobs); in maybeStartTrackingJobLocked()
349 jobs.add(jobStatus); in maybeStartTrackingJobLocked()
350 jobStatus.setTrackingController(JobStatus.TRACKING_CONNECTIVITY); in maybeStartTrackingJobLocked()
351 updateConstraintsSatisfied(jobStatus); in maybeStartTrackingJobLocked()
357 public void prepareForExecutionLocked(JobStatus jobStatus) { in prepareForExecutionLocked() argument
[all …]
DBackgroundJobsController.java146 public void maybeStartTrackingJobLocked(JobStatus jobStatus, JobStatus lastJob) { in maybeStartTrackingJobLocked() argument
147 updateSingleJobRestrictionLocked(jobStatus, sElapsedRealtimeClock.millis(), UNKNOWN); in maybeStartTrackingJobLocked()
152 public void maybeStopTrackingJobLocked(JobStatus jobStatus, JobStatus incomingJob) { in maybeStopTrackingJobLocked() argument
157 public void evaluateStateLocked(JobStatus jobStatus) { in evaluateStateLocked() argument
158 if (jobStatus.isRequestedExpeditedJob()) { in evaluateStateLocked()
161 updateSingleJobRestrictionLocked(jobStatus, sElapsedRealtimeClock.millis(), UNKNOWN); in evaluateStateLocked()
208 mService.getJobStore().forEachJob(predicate, (jobStatus) -> { in dumpControllerStateLocked()
209 final int uid = jobStatus.getSourceUid(); in dumpControllerStateLocked()
210 final String sourcePkg = jobStatus.getSourcePackageName(); in dumpControllerStateLocked()
212 jobStatus.printUniqueId(pw); in dumpControllerStateLocked()
[all …]
DDeviceIdleJobsController.java125 private final Predicate<JobStatus> mShouldRushEvaluation = (jobStatus) ->
126 jobStatus.isRequestedExpeditedJob() || mForegroundUids.get(jobStatus.getSourceUid());
221 public void maybeStartTrackingJobLocked(JobStatus jobStatus, JobStatus lastJob) { in maybeStartTrackingJobLocked() argument
222 if ((jobStatus.getFlags()&JobInfo.FLAG_IMPORTANT_WHILE_FOREGROUND) != 0) { in maybeStartTrackingJobLocked()
223 mAllowInIdleJobs.add(jobStatus); in maybeStartTrackingJobLocked()
225 updateTaskStateLocked(jobStatus, sElapsedRealtimeClock.millis()); in maybeStartTrackingJobLocked()
229 public void maybeStopTrackingJobLocked(JobStatus jobStatus, JobStatus incomingJob) { in maybeStopTrackingJobLocked() argument
230 if ((jobStatus.getFlags()&JobInfo.FLAG_IMPORTANT_WHILE_FOREGROUND) != 0) { in maybeStopTrackingJobLocked()
231 mAllowInIdleJobs.remove(jobStatus); in maybeStopTrackingJobLocked()
241 mService.getJobStore().forEachJob(predicate, (jobStatus) -> { in dumpControllerStateLocked()
[all …]
DComponentController.java128 public void maybeStartTrackingJobLocked(JobStatus jobStatus, JobStatus lastJob) { in maybeStartTrackingJobLocked() argument
129 updateComponentEnabledStateLocked(jobStatus); in maybeStartTrackingJobLocked()
133 public void maybeStopTrackingJobLocked(JobStatus jobStatus, JobStatus incomingJob) { in maybeStopTrackingJobLocked() argument
150 private String getServiceProcessLocked(JobStatus jobStatus) { in getServiceProcessLocked() argument
151 final ComponentName service = jobStatus.getServiceComponent(); in getServiceProcessLocked()
152 final int userId = jobStatus.getUserId(); in getServiceProcessLocked()
168 if (mService.areUsersStartedLocked(jobStatus)) { in getServiceProcessLocked()
182 private boolean updateComponentEnabledStateLocked(JobStatus jobStatus) { in updateComponentEnabledStateLocked() argument
183 final String processName = getServiceProcessLocked(jobStatus); in updateComponentEnabledStateLocked()
186 Slog.v(TAG, jobStatus.toShortString() + " component not present"); in updateComponentEnabledStateLocked()
[all …]
DStateController.java78 public abstract void maybeStartTrackingJobLocked(JobStatus jobStatus, JobStatus lastJob); in maybeStartTrackingJobLocked() argument
83 public void prepareForExecutionLocked(JobStatus jobStatus) { in prepareForExecutionLocked() argument
89 public void unprepareFromExecutionLocked(JobStatus jobStatus) { in unprepareFromExecutionLocked() argument
95 public abstract void maybeStopTrackingJobLocked(JobStatus jobStatus, JobStatus incomingJob); in maybeStopTrackingJobLocked() argument
132 public void evaluateStateLocked(JobStatus jobStatus) { in evaluateStateLocked() argument
157 protected boolean wouldBeReadyWithConstraintLocked(JobStatus jobStatus, int constraint) { in wouldBeReadyWithConstraintLocked() argument
159 final boolean jobWouldBeReady = jobStatus.wouldBeReadyWithConstraint(constraint); in wouldBeReadyWithConstraintLocked()
161 Slog.v(TAG, "wouldBeReadyWithConstraintLocked: " + jobStatus.toShortString() in wouldBeReadyWithConstraintLocked()
172 return mService.areComponentsInPlaceLocked(jobStatus); in wouldBeReadyWithConstraintLocked()
DBatteryController.java94 public void startTrackingRestrictedJobLocked(JobStatus jobStatus) { in startTrackingRestrictedJobLocked() argument
95 maybeStartTrackingJobLocked(jobStatus, null); in startTrackingRestrictedJobLocked()
100 public void prepareForExecutionLocked(JobStatus jobStatus) { in prepareForExecutionLocked() argument
101 if (!jobStatus.hasPowerConstraint()) { in prepareForExecutionLocked()
106 Slog.d(TAG, "Prepping for " + jobStatus.toShortString()); in prepareForExecutionLocked()
109 final int uid = jobStatus.getSourceUid(); in prepareForExecutionLocked()
112 Slog.d(TAG, jobStatus.toShortString() + " is top started job"); in prepareForExecutionLocked()
114 mTopStartedJobs.add(jobStatus); in prepareForExecutionLocked()
120 public void unprepareFromExecutionLocked(JobStatus jobStatus) { in unprepareFromExecutionLocked() argument
121 mTopStartedJobs.remove(jobStatus); in unprepareFromExecutionLocked()
[all …]
DQuotaController.java587 public void maybeStartTrackingJobLocked(JobStatus jobStatus, JobStatus lastJob) { in maybeStartTrackingJobLocked() argument
589 final int userId = jobStatus.getSourceUserId(); in maybeStartTrackingJobLocked()
590 final String pkgName = jobStatus.getSourcePackageName(); in maybeStartTrackingJobLocked()
596 jobs.add(jobStatus); in maybeStartTrackingJobLocked()
597 jobStatus.setTrackingController(JobStatus.TRACKING_QUOTA); in maybeStartTrackingJobLocked()
598 final boolean isWithinQuota = isWithinQuotaLocked(jobStatus); in maybeStartTrackingJobLocked()
600 jobStatus.isRequestedExpeditedJob() && isWithinEJQuotaLocked(jobStatus); in maybeStartTrackingJobLocked()
601 setConstraintSatisfied(jobStatus, nowElapsed, isWithinQuota, isWithinEJQuota); in maybeStartTrackingJobLocked()
603 if (jobStatus.isRequestedExpeditedJob()) { in maybeStartTrackingJobLocked()
604 setExpeditedQuotaApproved(jobStatus, nowElapsed, isWithinEJQuota); in maybeStartTrackingJobLocked()
[all …]
DPrefetchController.java152 public void maybeStartTrackingJobLocked(JobStatus jobStatus, JobStatus lastJob) { in maybeStartTrackingJobLocked() argument
153 if (jobStatus.getJob().isPrefetch()) { in maybeStartTrackingJobLocked()
154 final int userId = jobStatus.getSourceUserId(); in maybeStartTrackingJobLocked()
155 final String pkgName = jobStatus.getSourcePackageName(); in maybeStartTrackingJobLocked()
163 if (jobs.add(jobStatus) && jobs.size() == 1 in maybeStartTrackingJobLocked()
167 updateConstraintLocked(jobStatus, now, nowElapsed); in maybeStartTrackingJobLocked()
173 public void maybeStopTrackingJobLocked(JobStatus jobStatus, JobStatus incomingJob) { in maybeStopTrackingJobLocked() argument
174 final int userId = jobStatus.getSourceUserId(); in maybeStopTrackingJobLocked()
175 final String pkgName = jobStatus.getSourcePackageName(); in maybeStopTrackingJobLocked()
177 if (jobs != null && jobs.remove(jobStatus) && jobs.size() == 0) { in maybeStopTrackingJobLocked()
[all …]
DRestrictingController.java34 public abstract void startTrackingRestrictedJobLocked(JobStatus jobStatus); in startTrackingRestrictedJobLocked() argument
40 public abstract void stopTrackingRestrictedJobLocked(JobStatus jobStatus); in stopTrackingRestrictedJobLocked() argument
DIdleController.java77 public void startTrackingRestrictedJobLocked(JobStatus jobStatus) { in startTrackingRestrictedJobLocked() argument
78 maybeStartTrackingJobLocked(jobStatus, null); in startTrackingRestrictedJobLocked()
89 public void stopTrackingRestrictedJobLocked(JobStatus jobStatus) { in stopTrackingRestrictedJobLocked() argument
90 if (!jobStatus.hasIdleConstraint()) { in stopTrackingRestrictedJobLocked()
91 maybeStopTrackingJobLocked(jobStatus, null); in stopTrackingRestrictedJobLocked()
DJobStatus.java732 public JobStatus(JobStatus jobStatus) { in JobStatus() argument
733 this(jobStatus.getJob(), jobStatus.getUid(), in JobStatus()
734 jobStatus.getSourcePackageName(), jobStatus.getSourceUserId(), in JobStatus()
735 jobStatus.getStandbyBucket(), jobStatus.getNamespace(), in JobStatus()
736 jobStatus.getSourceTag(), jobStatus.getNumFailures(), jobStatus.getNumSystemStops(), in JobStatus()
737 jobStatus.getEarliestRunTime(), jobStatus.getLatestRunTimeElapsed(), in JobStatus()
738 jobStatus.getLastSuccessfulRunTime(), jobStatus.getLastFailedRunTime(), in JobStatus()
739 jobStatus.getCumulativeExecutionTimeMs(), in JobStatus()
740 jobStatus.getInternalFlags(), jobStatus.mDynamicConstraints); in JobStatus()
741 mPersistedUtcTimes = jobStatus.mPersistedUtcTimes; in JobStatus()
[all …]
DContentObserverController.java275 JobInstance(JobStatus jobStatus) { in JobInstance() argument
276 mJobStatus = jobStatus; in JobInstance()
279 final JobInfo.TriggerContentUri[] uris = jobStatus.getJob().getTriggerContentUris(); in JobInstance()
280 final int sourceUserId = jobStatus.getSourceUserId(); in JobInstance()
291 obs = new ObserverInstance(mHandler, uri, jobStatus.getSourceUserId()); in JobInstance()
DFlexibilityController.java396 public void prepareForExecutionLocked(JobStatus jobStatus) { in prepareForExecutionLocked() argument
397 if (jobStatus.lastEvaluatedBias == JobInfo.BIAS_TOP_APP) { in prepareForExecutionLocked()
403 final int priority = jobStatus.getJob().getPriority(); in prepareForExecutionLocked()
408 mJobScoreTrackers.get(jobStatus.getSourceUid(), jobStatus.getSourcePackageName()); in prepareForExecutionLocked()
411 mJobScoreTrackers.add(jobStatus.getSourceUid(), jobStatus.getSourcePackageName(), in prepareForExecutionLocked()
418 public void unprepareFromExecutionLocked(JobStatus jobStatus) { in unprepareFromExecutionLocked() argument
419 if (jobStatus.lastEvaluatedBias == JobInfo.BIAS_TOP_APP) { in unprepareFromExecutionLocked()
425 mJobScoreTrackers.get(jobStatus.getSourceUid(), jobStatus.getSourcePackageName()); in unprepareFromExecutionLocked()
430 final int priority = jobStatus.getJob().getPriority(); in unprepareFromExecutionLocked()
/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/
DJobNotificationCoordinator.java117 final JobStatus jobStatus = hostingContext.getRunningJobLocked(); in enqueueNotification() local
118 if (jobStatus == null) { in enqueueNotification()
124 if (jobStatus.startedAsUserInitiatedJob) { in enqueueNotification()
127 jobStatus.getUid()); in enqueueNotification()
131 jobStatus.getUid()); in enqueueNotification()
134 if (jobStatus.startedAsUserInitiatedJob) { in enqueueNotification()
137 jobStatus.getUid()); in enqueueNotification()
141 jobStatus.getUid()); in enqueueNotification()
146 jobStatus); in enqueueNotification()
149 jobStatus.getUid()); in enqueueNotification()
[all …]
DJobStore.java287 public void add(JobStatus jobStatus) { in add() argument
288 if (mJobSet.add(jobStatus)) { in add()
292 if (jobStatus.isPersisted()) { in add()
293 mPendingJobWriteUids.put(jobStatus.getUid(), true); in add()
297 Slog.d(TAG, "Added job status to store: " + jobStatus); in add()
305 public void addForTesting(JobStatus jobStatus) { in addForTesting() argument
306 if (mJobSet.add(jobStatus)) { in addForTesting()
310 if (jobStatus.isPersisted()) { in addForTesting()
311 mPendingJobWriteUids.put(jobStatus.getUid(), true); in addForTesting()
315 boolean containsJob(JobStatus jobStatus) { in containsJob() argument
[all …]
DJobSchedulerService.java1825 JobStatus jobStatus = JobStatus.createFromJobInfo(
1829 if (jobStatus.isRequestedExpeditedJob()) {
1830 if (!mQuotaController.isWithinEJQuotaLocked(jobStatus)) {
1842 jobStatus.maybeAddForegroundExemption(mIsUidActivePredicate);
1844 if (DEBUG) Slog.d(TAG, "SCHEDULE: " + jobStatus.toShortString());
1857 jobStatus.prepareLocked();
1881 cancelJobImplLocked(toCancel, jobStatus, JobParameters.STOP_REASON_CANCELLED_BY_APP,
1884 startTrackingJobLocked(jobStatus, null);
1889 jobStatus.enqueueWorkLocked(work);
1891 .logSampleWithUid(callingUid, jobStatus.getWorkCount());
[all …]
DStateChangedListener.java57 public void onRunJobNow(JobStatus jobStatus); in onRunJobNow() argument
61 void onNetworkChanged(JobStatus jobStatus, Network newNetwork); in onNetworkChanged() argument
DPendingJobQueue.java318 void add(@NonNull JobStatus jobStatus) { in add() argument
323 adjustedJobStatus.adjustedEnqueueTime = jobStatus.enqueueTime; in add()
324 adjustedJobStatus.job = jobStatus; in add()
401 private int indexOf(@NonNull JobStatus jobStatus) { in indexOf() argument
407 if (adjustedJobStatus.job == jobStatus) { in indexOf()
436 boolean remove(@NonNull JobStatus jobStatus) { in remove() argument
437 final int idx = indexOf(jobStatus); in remove()
DJobConcurrencyManager.java688 final JobStatus jobStatus = jsc.getRunningJobLocked(); in isJobInOvertimeLocked() local
690 if (jobStatus == job) { in isJobInOvertimeLocked()
1359 final JobStatus jobStatus = jsc.getRunningJobLocked(); in stopOvertimeJobsLocked() local
1361 if (jobStatus != null && !jsc.isWithinExecutionGuaranteeTime()) { in stopOvertimeJobsLocked()
1376 final JobStatus jobStatus = jsc.getRunningJobLocked(); in maybeStopOvertimeJobsLocked() local
1378 if (jobStatus != null in maybeStopOvertimeJobsLocked()
1381 jobStatus, mService.evaluateJobBiasLocked(jobStatus))) { in maybeStopOvertimeJobsLocked()
1395 final JobStatus jobStatus = jsc.getRunningJobLocked(); in markJobsForUserStopLocked() local
1400 if (jobStatus != null && userId == jobStatus.getUserId() in markJobsForUserStopLocked()
1401 && jobStatus.getServiceComponent().getPackageName().equals(packageName)) { in markJobsForUserStopLocked()
[all …]
DJobCompletedListener.java37 void onJobCompletedLocked(JobStatus jobStatus, int stopReason, int internalStopReason, in onJobCompletedLocked() argument
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/job/controllers/
DPrefetchControllerTest.java277 JobStatus jobStatus = createJobStatus("testConstantsUpdating_ThresholdChangesAlarms", 1); in testConstantsUpdating_ThresholdChangesAlarms() local
278 trackJobs(jobStatus); in testConstantsUpdating_ThresholdChangesAlarms()
407 JobStatus jobStatus = createJobStatus("testEstimatedLaunchTimeChangedToLate", 1); in testEstimatedLaunchTimeChangedToLate() local
408 trackJobs(jobStatus); in testEstimatedLaunchTimeChangedToLate()
412 assertTrue(jobStatus.isConstraintSatisfied(JobStatus.CONSTRAINT_PREFETCH)); in testEstimatedLaunchTimeChangedToLate()
413 assertTrue(jobStatus.isReady()); in testEstimatedLaunchTimeChangedToLate()
424 assertFalse(jobStatus.isConstraintSatisfied(JobStatus.CONSTRAINT_PREFETCH)); in testEstimatedLaunchTimeChangedToLate()
425 assertFalse(jobStatus.isReady()); in testEstimatedLaunchTimeChangedToLate()
438 JobStatus jobStatus = createJobStatus("testEstimatedLaunchTimeChangedToSoon", 1); in testEstimatedLaunchTimeChangedToSoon() local
439 trackJobs(jobStatus); in testEstimatedLaunchTimeChangedToSoon()
[all …]
DQuotaControllerTest.java863 JobStatus jobStatus = createJobStatus("testUpdateExecutionStatsLocked_WithTimer", i); in testUpdateExecutionStatsLocked_WithTimer() local
864 setStandbyBucket(RARE_INDEX, jobStatus); // 24 hour window in testUpdateExecutionStatsLocked_WithTimer()
866 mQuotaController.maybeStartTrackingJobLocked(jobStatus, null); in testUpdateExecutionStatsLocked_WithTimer()
867 mQuotaController.prepareForExecutionLocked(jobStatus); in testUpdateExecutionStatsLocked_WithTimer()
882 assertTrue("Job not ready: " + jobStatus, jobStatus.isReady()); in testUpdateExecutionStatsLocked_WithTimer()
908 JobStatus jobStatus = createJobStatus("testUpdateExecutionStatsLocked_WithTimer", 0); in testUpdateExecutionStatsLocked_WithTimer() local
909 setStandbyBucket(RARE_INDEX, jobStatus); // 24 hour window in testUpdateExecutionStatsLocked_WithTimer()
911 mQuotaController.maybeStartTrackingJobLocked(jobStatus, null); in testUpdateExecutionStatsLocked_WithTimer()
912 mQuotaController.prepareForExecutionLocked(jobStatus); in testUpdateExecutionStatsLocked_WithTimer()
930 assertFalse("Job unexpectedly ready: " + jobStatus, jobStatus.isReady()); in testUpdateExecutionStatsLocked_WithTimer()
[all …]
DStateControllerTest.java81 public void maybeStartTrackingJobLocked(JobStatus jobStatus, JobStatus lastJob) { in maybeStartTrackingJobLocked() argument
84 public void maybeStopTrackingJobLocked(JobStatus jobStatus, JobStatus incomingJob) { in maybeStopTrackingJobLocked() argument
DJobStatusTest.java127 private static void assertEffectiveBucketForMediaExemption(JobStatus jobStatus, in assertEffectiveBucketForMediaExemption() argument
137 jobStatus.setStandbyBucket(effectiveBucket.keyAt(i)); in assertEffectiveBucketForMediaExemption()
138 assertEquals(effectiveBucket.valueAt(i), jobStatus.getEffectiveStandbyBucket()); in assertEffectiveBucketForMediaExemption()
1368 JobStatus jobStatus = JobStatus.createFromJobInfo(job, 0, null, -1, "JobStatusTest", null); in createJobStatus() local
1369 jobStatus.serviceProcessName = "testProcess"; in createJobStatus()
1370 return jobStatus; in createJobStatus()
/frameworks/base/services/tests/servicestests/src/com/android/server/job/
DJobStoreTest.java398 for (JobStatus jobStatus : jobStatuses) { in runWritingJobsToDisk()
399 mTaskStoreUnderTest.add(jobStatus); in runWritingJobsToDisk()
400 expectedJobs.add(jobStatus); in runWritingJobsToDisk()
427 for (JobStatus jobStatus : jobStatuses) { in runWritingJobsToDisk()
428 assertTrue("JobStore#contains invalid.", mTaskStoreUnderTest.containsJob(jobStatus)); in runWritingJobsToDisk()
653 JobStatus jobStatus = jobStatusSet.getAllJobs().iterator().next(); in testNonPersistedTaskIsNotPersisted() local
654 assertEquals("Wrong job persisted.", 43, jobStatus.getJobId()); in testNonPersistedTaskIsNotPersisted()
840 JobStatus jobStatus = in testJobWorkItems() local
842 jobStatus.executingWork = new ArrayList<>(List.of(item1, item2)); in testJobWorkItems()
843 jobStatus.pendingWork = new ArrayList<>(List.of(item3, item4, item5)); in testJobWorkItems()
[all …]