Home
last modified time | relevance | path

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

12

/frameworks/support/work/workmanager-firebase/src/main/java/androidx/work/impl/background/firebase/
DFirebaseJobService.java59 String workSpecId = params.getTag(); in onStartJob() local
60 if (TextUtils.isEmpty(workSpecId)) { in onStartJob()
65 Log.d(TAG, String.format("onStartJob for %s", workSpecId)); in onStartJob()
67 mJobParameters.put(workSpecId, params); in onStartJob()
69 mWorkManagerImpl.startWork(workSpecId); in onStartJob()
75 String workSpecId = params.getTag(); in onStopJob() local
76 if (TextUtils.isEmpty(workSpecId)) { in onStopJob()
81 Log.d(TAG, String.format("onStopJob for %s", workSpecId)); in onStopJob()
84 mJobParameters.remove(workSpecId); in onStopJob()
86 mWorkManagerImpl.stopWork(workSpecId); in onStopJob()
[all …]
DFirebaseDelayedJobAlarmReceiver.java43 final String workSpecId = intent.getStringExtra(WORKSPEC_ID_KEY); in onReceive() local
51 WorkSpec workSpec = database.workSpecDao().getWorkSpec(workSpecId); in onReceive()
/frameworks/support/work/workmanager/src/main/java/androidx/work/impl/background/systemjob/
DSystemJobService.java64 String workSpecId = extras.getString(SystemJobInfoConverter.EXTRA_WORK_SPEC_ID); in onStartJob() local
65 if (TextUtils.isEmpty(workSpecId)) { in onStartJob()
71 if (mJobParameters.containsKey(workSpecId)) { in onStartJob()
75 "Job is already being executed by SystemJobService: %s", workSpecId)); in onStartJob()
82 "Override deadline expired for id %s. Retry requested", workSpecId)); in onStartJob()
87 Log.d(TAG, String.format("onStartJob for %s", workSpecId)); in onStartJob()
88 mJobParameters.put(workSpecId, params); in onStartJob()
106 mWorkManagerImpl.startWork(workSpecId, runtimeExtras); in onStartJob()
112 String workSpecId = params.getExtras().getString(SystemJobInfoConverter.EXTRA_WORK_SPEC_ID); in onStopJob() local
113 if (TextUtils.isEmpty(workSpecId)) { in onStopJob()
[all …]
/frameworks/support/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/
DCommandHandler.java64 static Intent createScheduleWorkIntent(@NonNull Context context, @NonNull String workSpecId) { in createScheduleWorkIntent() argument
67 intent.putExtra(KEY_WORKSPEC_ID, workSpecId); in createScheduleWorkIntent()
71 static Intent createDelayMetIntent(@NonNull Context context, @NonNull String workSpecId) { in createDelayMetIntent() argument
74 intent.putExtra(KEY_WORKSPEC_ID, workSpecId); in createDelayMetIntent()
78 static Intent createStopWorkIntent(@NonNull Context context, @NonNull String workSpecId) { in createStopWorkIntent() argument
81 intent.putExtra(KEY_WORKSPEC_ID, workSpecId); in createStopWorkIntent()
99 @NonNull String workSpecId, in createExecutionCompletedIntent() argument
105 intent.putExtra(KEY_WORKSPEC_ID, workSpecId); in createExecutionCompletedIntent()
124 @NonNull String workSpecId, in onExecuted()
131 ExecutionListener listener = mPendingDelayMet.remove(workSpecId); in onExecuted()
[all …]
DWorkTimer.java57 void startTimer(@NonNull final String workSpecId, in startTimer() argument
62 Log.d(TAG, String.format("Starting timer for %s", workSpecId)); in startTimer()
64 stopTimer(workSpecId); in startTimer()
65 WorkTimerRunnable runnable = new WorkTimerRunnable(this, workSpecId); in startTimer()
66 mTimerMap.put(workSpecId, runnable); in startTimer()
67 mListeners.put(workSpecId, listener); in startTimer()
72 void stopTimer(@NonNull final String workSpecId) { in stopTimer() argument
74 if (mTimerMap.containsKey(workSpecId)) { in stopTimer()
75 Log.d(TAG, String.format("Stopping timer for %s", workSpecId)); in stopTimer()
76 mTimerMap.remove(workSpecId); in stopTimer()
[all …]
DAlarms.java57 @NonNull String workSpecId, in setAlarm() argument
62 SystemIdInfo systemIdInfo = systemIdInfoDao.getSystemIdInfo(workSpecId); in setAlarm()
64 cancelExactAlarm(context, workSpecId, systemIdInfo.systemId); in setAlarm()
65 setExactAlarm(context, workSpecId, systemIdInfo.systemId, triggerAtMillis); in setAlarm()
69 SystemIdInfo newSystemIdInfo = new SystemIdInfo(workSpecId, alarmId); in setAlarm()
71 setExactAlarm(context, workSpecId, alarmId, triggerAtMillis); in setAlarm()
85 @NonNull String workSpecId) { in cancelAlarm() argument
89 SystemIdInfo systemIdInfo = systemIdInfoDao.getSystemIdInfo(workSpecId); in cancelAlarm()
91 cancelExactAlarm(context, workSpecId, systemIdInfo.systemId); in cancelAlarm()
92 Log.d(TAG, String.format("Removing SystemIdInfo for workSpecId (%s)", workSpecId)); in cancelAlarm()
[all …]
DConstraintsCommandHandler.java88 String workSpecId = workSpec.id; in handleConstraintsChanged() local
90 || mWorkConstraintsTracker.areAllConstraintsMet(workSpecId)) { in handleConstraintsChanged()
96 String workSpecId = workSpec.id; in handleConstraintsChanged() local
97 Intent intent = CommandHandler.createDelayMetIntent(mContext, workSpecId); in handleConstraintsChanged()
99 "Creating a delay_met command for workSpec with id (%s)", workSpecId)); in handleConstraintsChanged()
DDelayMetCommandHandler.java65 @NonNull String workSpecId, in DelayMetCommandHandler() argument
71 mWorkSpecId = workSpecId; in DelayMetCommandHandler()
103 @NonNull String workSpecId, in onExecuted()
108 "onExecuted %s, %s, %s", workSpecId, isSuccessful, needsReschedule)); in onExecuted()
123 public void onTimeLimitExceeded(@NonNull String workSpecId) { in onTimeLimitExceeded() argument
124 Log.d(TAG, String.format("Exceeded time limits on execution for %s", workSpecId)); in onTimeLimitExceeded()
DSystemAlarmScheduler.java52 public void cancel(@NonNull String workSpecId) { in cancel() argument
53 Intent cancelIntent = CommandHandler.createStopWorkIntent(mContext, workSpecId); in cancel()
/frameworks/support/work/workmanager/src/main/java/androidx/work/impl/background/greedy/
DGreedyScheduler.java94 public synchronized void cancel(@NonNull String workSpecId) { in cancel() argument
95 Log.d(TAG, String.format("Cancelling work ID %s", workSpecId)); in cancel()
96 mWorkManagerImpl.stopWork(workSpecId); in cancel()
97 removeConstraintTrackingFor(workSpecId); in cancel()
102 for (String workSpecId : workSpecIds) { in onAllConstraintsMet()
103 Log.d(TAG, String.format("Constraints met: Scheduling work ID %s", workSpecId)); in onAllConstraintsMet()
104 mWorkManagerImpl.startWork(workSpecId); in onAllConstraintsMet()
110 for (String workSpecId : workSpecIds) { in onAllConstraintsNotMet()
111 Log.d(TAG, String.format("Constraints not met: Cancelling work ID %s", workSpecId)); in onAllConstraintsNotMet()
112 mWorkManagerImpl.stopWork(workSpecId); in onAllConstraintsNotMet()
[all …]
/frameworks/support/work/workmanager/src/main/java/androidx/work/impl/utils/
DCancelWorkRunnable.java47 void cancel(WorkManagerImpl workManagerImpl, String workSpecId) { in cancel() argument
48 recursivelyCancelWorkAndDependents(workManagerImpl.getWorkDatabase(), workSpecId); in cancel() local
51 processor.stopAndCancelWork(workSpecId); in cancel()
54 scheduler.cancel(workSpecId); in cancel()
65 private void recursivelyCancelWorkAndDependents(WorkDatabase workDatabase, String workSpecId) { in recursivelyCancelWorkAndDependents() argument
70 List<String> dependentIds = dependencyDao.getDependentWorkIds(workSpecId); in recursivelyCancelWorkAndDependents()
75 State state = workSpecDao.getState(workSpecId); in recursivelyCancelWorkAndDependents()
77 workSpecDao.setState(CANCELLED, workSpecId); in recursivelyCancelWorkAndDependents()
120 for (String workSpecId : workSpecIds) {
121 cancel(workManagerImpl, workSpecId);
[all …]
DStartWorkRunnable.java40 String workSpecId, in StartWorkRunnable() argument
43 mWorkSpecId = workSpecId; in StartWorkRunnable()
DStopWorkRunnable.java40 public StopWorkRunnable(WorkManagerImpl workManagerImpl, String workSpecId) { in StopWorkRunnable() argument
42 mWorkSpecId = workSpecId; in StopWorkRunnable()
/frameworks/support/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/
DAlarmsTest.java64 String workSpecId = work.getStringId(); in testSetAlarm_noPreExistingAlarms() local
66 Alarms.setAlarm(mContext, mWorkManager, workSpecId, mTriggerAt); in testSetAlarm_noPreExistingAlarms()
67 SystemIdInfo systemIdInfo = mDatabase.systemIdInfoDao().getSystemIdInfo(workSpecId); in testSetAlarm_noPreExistingAlarms()
75 String workSpecId = work.getStringId(); in testSetAlarm_withPreExistingAlarms() local
77 SystemIdInfo systemIdInfo = new SystemIdInfo(workSpecId, 1); in testSetAlarm_withPreExistingAlarms()
80 Alarms.setAlarm(mContext, mWorkManager, workSpecId, mTriggerAt); in testSetAlarm_withPreExistingAlarms()
81 SystemIdInfo updatedSystemIdInfo = mDatabase.systemIdInfoDao().getSystemIdInfo(workSpecId); in testSetAlarm_withPreExistingAlarms()
90 String workSpecId = work.getStringId(); in testCancelAlarm() local
92 SystemIdInfo systemIdInfo = new SystemIdInfo(workSpecId, 1); in testCancelAlarm()
95 Alarms.cancelAlarm(mContext, mWorkManager, workSpecId); in testCancelAlarm()
[all …]
DSystemAlarmDispatcherTest.java165 String workSpecId = work.getStringId(); in testSchedule() local
166 final Intent intent = CommandHandler.createScheduleWorkIntent(mContext, workSpecId); in testSchedule()
179 String workSpecId = work.getStringId(); in testDelayMet_success() local
180 final Intent intent = CommandHandler.createDelayMetIntent(mContext, workSpecId); in testDelayMet_success()
185 verify(mSpyProcessor, times(1)).startWork(workSpecId); in testDelayMet_success()
197 String workSpecId = work.getStringId(); in testDelayMet_withStop() local
199 final Intent delayMet = CommandHandler.createDelayMetIntent(mContext, workSpecId); in testDelayMet_withStop()
200 final Intent stopWork = CommandHandler.createStopWorkIntent(mContext, workSpecId); in testDelayMet_withStop()
211 verify(mSpyProcessor, times(1)).startWork(workSpecId); in testDelayMet_withStop()
212 verify(mWorkManager, times(1)).stopWork(workSpecId); in testDelayMet_withStop()
[all …]
/frameworks/support/work/workmanager/src/main/java/androidx/work/impl/model/
DSystemIdInfo.java43 public final String workSpecId; field in SystemIdInfo
48 public SystemIdInfo(@NonNull String workSpecId, int systemId) { in SystemIdInfo() argument
49 this.workSpecId = workSpecId; in SystemIdInfo()
61 return workSpecId.equals(that.workSpecId); in equals()
66 int result = workSpecId.hashCode(); in hashCode()
DWorkName.java50 public final String workSpecId; field in WorkName
52 public WorkName(@NonNull String name, @NonNull String workSpecId) { in WorkName() argument
54 this.workSpecId = workSpecId; in WorkName()
DWorkTag.java50 public final String workSpecId; field in WorkTag
52 public WorkTag(@NonNull String tag, @NonNull String workSpecId) { in WorkTag() argument
54 this.workSpecId = workSpecId; in WorkTag()
DDependency.java53 public final String workSpecId; field in Dependency
59 public Dependency(@NonNull String workSpecId, @NonNull String prerequisiteId) { in Dependency() argument
60 this.workSpecId = workSpecId; in Dependency()
DSystemIdInfoDao.java46 SystemIdInfo getSystemIdInfo(@NonNull String workSpecId); in getSystemIdInfo() argument
54 void removeSystemIdInfo(@NonNull String workSpecId); in removeSystemIdInfo() argument
/frameworks/support/work/workmanager/src/main/java/androidx/work/impl/constraints/
DWorkConstraintsTracker.java106 public boolean areAllConstraintsMet(@NonNull String workSpecId) { in areAllConstraintsMet() argument
108 if (constraintController.isWorkSpecConstrained(workSpecId)) { in areAllConstraintsMet()
109 Log.d(TAG, String.format("Work %s constrained by %s", workSpecId, in areAllConstraintsMet()
120 for (String workSpecId : workSpecIds) { in onConstraintMet()
121 if (areAllConstraintsMet(workSpecId)) { in onConstraintMet()
122 Log.d(TAG, String.format("Constraints met for %s", workSpecId)); in onConstraintMet()
123 unconstrainedWorkSpecIds.add(workSpecId); in onConstraintMet()
/frameworks/support/work/workmanager-test/src/main/java/androidx/work/test/
DTestScheduler.java72 public void cancel(@NonNull String workSpecId) { in cancel() argument
74 WorkManagerImpl.getInstance().stopWork(workSpecId); in cancel()
84 void setAllConstraintsMet(@NonNull UUID workSpecId) { in setAllConstraintsMet() argument
86 WorkSpec workSpec = mWorkSpecs.get(workSpecId.toString()); in setAllConstraintsMet()
95 @NonNull String workSpecId, in onExecuted()
100 mWorkSpecs.remove(workSpecId); in onExecuted()
/frameworks/support/work/workmanager/src/androidTest/java/androidx/work/impl/workers/
DConstraintTrackingWorkerTest.java144 String workSpecId = work.getStringId(); in testConstraintTrackingWorker_onConstraintsMet() local
157 new WorkerWrapper.Builder(mContext, mConfiguration, mDatabase, workSpecId); in testConstraintTrackingWorker_onConstraintsMet()
164 WorkSpec workSpec = mDatabase.workSpecDao().getWorkSpec(workSpecId); in testConstraintTrackingWorker_onConstraintsMet()
190 String workSpecId = work.getStringId(); in testConstraintTrackingWorker_onConstraintsNotMet() local
203 new WorkerWrapper.Builder(mContext, mConfiguration, mDatabase, workSpecId); in testConstraintTrackingWorker_onConstraintsNotMet()
210 WorkSpec workSpec = mDatabase.workSpecDao().getWorkSpec(workSpecId); in testConstraintTrackingWorker_onConstraintsNotMet()
235 String workSpecId = work.getStringId(); in testConstraintTrackingWorker_onConstraintsChanged() local
247 new WorkerWrapper.Builder(mContext, mConfiguration, mDatabase, workSpecId); in testConstraintTrackingWorker_onConstraintsChanged()
261 WorkSpec workSpec = mDatabase.workSpecDao().getWorkSpec(workSpecId); in testConstraintTrackingWorker_onConstraintsChanged()
287 String workSpecId = work.getStringId(); in testConstraintTrackingWorker_onConstraintsChangedTwice() local
[all …]
/frameworks/support/work/workmanager/src/main/java/androidx/work/impl/
DProcessor.java164 public synchronized boolean isEnqueued(@NonNull String workSpecId) { in isEnqueued() argument
165 return mEnqueuedWorkMap.containsKey(workSpecId); in isEnqueued()
190 @NonNull String workSpecId, in onExecuted()
194 mEnqueuedWorkMap.remove(workSpecId); in onExecuted()
196 getClass().getSimpleName(), workSpecId, isSuccessful, needsReschedule)); in onExecuted()
200 executionListener.onExecuted(workSpecId, isSuccessful, needsReschedule); in onExecuted()
DWorkerWrapper.java309 private void recursivelyFailWorkAndDependents(String workSpecId) { in recursivelyFailWorkAndDependents() argument
310 List<String> dependentIds = mDependencyDao.getDependentWorkIds(workSpecId); in recursivelyFailWorkAndDependents()
316 if (mWorkSpecDao.getState(workSpecId) != CANCELLED) { in recursivelyFailWorkAndDependents()
317 mWorkSpecDao.setState(FAILED, workSpecId); in recursivelyFailWorkAndDependents()
383 UUID workSpecId = UUID.fromString(workSpec.id); in workerFromWorkSpec() local
387 workSpecId, in workerFromWorkSpec()
407 @NonNull UUID workSpecId, in workerFromClassName() argument
422 workSpecId, in workerFromClassName()
450 @NonNull String workSpecId) { in Builder() argument
454 mWorkSpecId = workSpecId; in Builder()

12