29 lines
985 B
Java
29 lines
985 B
Java
package androidx.work.impl.utils;
|
|
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.work.Operation;
|
|
import androidx.work.impl.OperationImpl;
|
|
import androidx.work.impl.WorkManagerImpl;
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
public class PruneWorkRunnable implements Runnable {
|
|
private final OperationImpl mOperation = new OperationImpl();
|
|
private final WorkManagerImpl mWorkManagerImpl;
|
|
|
|
public PruneWorkRunnable(WorkManagerImpl workManagerImpl) {
|
|
this.mWorkManagerImpl = workManagerImpl;
|
|
}
|
|
|
|
public Operation getOperation() {
|
|
return this.mOperation;
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
try {
|
|
this.mWorkManagerImpl.getWorkDatabase().workSpecDao().pruneFinishedWorkWithZeroDependentsIgnoringKeepForAtLeast();
|
|
this.mOperation.setState(Operation.SUCCESS);
|
|
} catch (Throwable th) {
|
|
this.mOperation.setState(new Operation.State.FAILURE(th));
|
|
}
|
|
}
|
|
}
|