Back to Exoplayer

PriorityTaskManager (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/util/PriorityTaskManager.html

latest4.3 KB
Original Source

Package com.google.android.exoplayer2.util

Class PriorityTaskManager


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classPriorityTaskManagerextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

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.

Allows tasks with associated priorities to control how they proceed relative to one another.

A task should call add(int) to register with the manager and remove(int) to unregister. A registered task will prevent tasks of lower priority from proceeding, and should call proceed(int), proceedNonBlocking(int) or proceedOrThrow(int) each time it wishes to check whether it is itself allowed to proceed.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static class | PriorityTaskManager.PriorityTooLowException | Deprecated.

Thrown when task attempts to proceed when another registered task has a higher priority. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | PriorityTaskManager() | Deprecated. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | add​(int priority) | Deprecated.

Register a new task. | | void | proceed​(int priority) | Deprecated.

Blocks until the task is allowed to proceed. | | boolean | proceedNonBlocking​(int priority) | Deprecated.

A non-blocking variant of proceed(int). | | void | proceedOrThrow​(int priority) | Deprecated.

A throwing variant of proceed(int). | | void | remove​(int priority) | Deprecated.

Unregister a task. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

PriorityTaskManager

public PriorityTaskManager()

Deprecated.

Method Detail

- 

add

public void add​(int priority)

Deprecated.

Register a new task. The task must call remove(int) when done. Parameters:priority - The priority of the task. Larger values indicate higher priorities.

- 

proceed

public void proceed​(int priority)
             throws[InterruptedException](https://developer.android.com/reference/java/lang/InterruptedException.html "class or interface in java.lang")

Deprecated.

Blocks until the task is allowed to proceed. Parameters:priority - The priority of the task.Throws:InterruptedException - If the thread is interrupted.

- 

proceedNonBlocking

public boolean proceedNonBlocking​(int priority)

Deprecated.

A non-blocking variant of proceed(int). Parameters:priority - The priority of the task.Returns:Whether the task is allowed to proceed.

- 

proceedOrThrow

public void proceedOrThrow​(int priority)
                    throws[PriorityTaskManager.PriorityTooLowException](PriorityTaskManager.PriorityTooLowException.html "class in com.google.android.exoplayer2.util")

Deprecated.

A throwing variant of proceed(int). Parameters:priority - The priority of the task.Throws:PriorityTaskManager.PriorityTooLowException - If the task is not allowed to proceed.

- 

remove

public void remove​(int priority)

Deprecated.

Unregister a task. Parameters:priority - The priority of the task.