// auto mode
// check if the dependency is fresh or it can be
// revalidated
final DependencyContext dependencyContext =
getPipelineContext().getDependencyContext();
final Dependency dependency = value.getDependency();
Freshness freshness =
dependency.freshness(dependencyContext);
if (freshness == Freshness.REVALIDATE) {
freshness =
dependency.revalidate(dependencyContext);
}
// if the dependency is fresh, cache can play the
// content back
if (freshness == Freshness.FRESH) {
// Get the recording from the cache.
recording = value.getRecording();
this.state =
CacheBodyOperationProcessState.PLAYBACK_AND_SUPPRESS;
final SystemClock clock =
SystemClock.getDefaultInstance();
final Time currentTime = clock.getCurrentTime();
final PipelineCacheState pcs =
new PipelineCacheState(currentTime.addPeriod(
dependency.getTimeToLive()));
dependencyContext.addDependency(dependency);
// update the cache with the old value so other
// threads don't need to wait the timeout period
ProviderResult result = new ProviderResult(