docs/doc/reference/com/google/android/exoplayer2/upstream/cache/NoOpCacheEvictor.html
Package com.google.android.exoplayer2.upstream.cache
All Implemented Interfaces:Cache.Listener, CacheEvictor
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classNoOpCacheEvictorextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[CacheEvictor](CacheEvictor.html "interface in com.google.android.exoplayer2.upstream.cache")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Evictor that doesn't ever evict cache files.
Warning: Using this evictor might have unforeseeable consequences if cache size is not managed elsewhere.
Constructors | Constructor | Description |
| --- | --- |
| NoOpCacheEvictor() |
Deprecated.
|
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| void | onCacheInitialized() |
Deprecated.
Called when cache has been initialized.
|
| void | onSpanAdded(Cache cache, CacheSpan span) |
Deprecated.
Called when a CacheSpan is added to the cache.
|
| void | onSpanRemoved(Cache cache, CacheSpan span) |
Deprecated.
Called when a CacheSpan is removed from the cache.
|
| void | onSpanTouched(Cache cache, CacheSpan oldSpan, CacheSpan newSpan) |
Deprecated.
Called when an existing CacheSpan is touched, causing it to be replaced.
|
| void | onStartFile(Cache cache, String key, long position, long length) |
Deprecated.
Called when a writer starts writing to the cache.
|
| boolean | requiresCacheSpanTouches() |
Deprecated.
Returns whether the evictor requires the Cache to touch CacheSpans when it accesses them.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public NoOpCacheEvictor()
Deprecated.
-
public boolean requiresCacheSpanTouches()
Deprecated.
Description copied from interface: CacheEvictor
Returns whether the evictor requires the Cache to touch CacheSpans when it accesses them. Implementations that do not use CacheSpan.lastTouchTimestamp should return false.
Specified by:requiresCacheSpanTouches in interface CacheEvictor
-
public void onCacheInitialized()
Deprecated.
Description copied from interface: CacheEvictor
Called when cache has been initialized.
Specified by:onCacheInitialized in interface CacheEvictor
-
public void onStartFile([Cache](Cache.html "interface in com.google.android.exoplayer2.upstream.cache")cache,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")key,
long position,
long length)
Deprecated.
Description copied from interface: CacheEvictor
Called when a writer starts writing to the cache.
Specified by:onStartFile in interface CacheEvictorParameters:cache - The source of the event.key - The key being written.position - The starting position of the data being written.length - The length of the data being written, or C.LENGTH_UNSET if unknown.
-
public void onSpanAdded([Cache](Cache.html "interface in com.google.android.exoplayer2.upstream.cache")cache,[CacheSpan](CacheSpan.html "class in com.google.android.exoplayer2.upstream.cache")span)
Deprecated.
Description copied from interface: Cache.Listener
Called when a CacheSpan is added to the cache.
Specified by:onSpanAdded in interface Cache.ListenerParameters:cache - The source of the event.span - The added CacheSpan.
-
public void onSpanRemoved([Cache](Cache.html "interface in com.google.android.exoplayer2.upstream.cache")cache,[CacheSpan](CacheSpan.html "class in com.google.android.exoplayer2.upstream.cache")span)
Deprecated.
Description copied from interface: Cache.Listener
Called when a CacheSpan is removed from the cache.
Specified by:onSpanRemoved in interface Cache.ListenerParameters:cache - The source of the event.span - The removed CacheSpan.
-
public void onSpanTouched([Cache](Cache.html "interface in com.google.android.exoplayer2.upstream.cache")cache,[CacheSpan](CacheSpan.html "class in com.google.android.exoplayer2.upstream.cache")oldSpan,[CacheSpan](CacheSpan.html "class in com.google.android.exoplayer2.upstream.cache")newSpan)
Deprecated.
Description copied from interface: Cache.Listener
Called when an existing CacheSpan is touched, causing it to be replaced. The new CacheSpan is guaranteed to represent the same data as the one it replaces, however CacheSpan.file and CacheSpan.lastTouchTimestamp may have changed.
Note that for span replacement, Cache.Listener.onSpanAdded(Cache, CacheSpan) and Cache.Listener.onSpanRemoved(Cache, CacheSpan) are not called in addition to this method.
Specified by:onSpanTouched in interface Cache.ListenerParameters:cache - The source of the event.oldSpan - The old CacheSpan, which has been removed from the cache.newSpan - The new CacheSpan, which has been added to the cache.