Commit 4de4f857 by krocard Committed by kim-vde

Document threading guarantee of Player.addListener

These guarantees were documented for `EventListener` and
hold as well for Listener but were not documented.

PiperOrigin-RevId: 382498188
parent a24bbbdd
...@@ -1262,9 +1262,11 @@ public interface Player { ...@@ -1262,9 +1262,11 @@ public interface Player {
Looper getApplicationLooper(); Looper getApplicationLooper();
/** /**
* Registers a listener to receive events from the player. The listener's methods will be called * Registers a listener to receive events from the player.
* on the thread that was used to construct the player. However, if the thread used to construct *
* the player does not have a {@link Looper}, then the listener will be called on the main thread. * <p>The listener's methods will be called on the thread that was used to construct the player.
* However, if the thread used to construct the player does not have a {@link Looper}, then the
* listener will be called on the main thread.
* *
* @param listener The listener to register. * @param listener The listener to register.
* @deprecated Use {@link #addListener(Listener)} and {@link #removeListener(Listener)} instead. * @deprecated Use {@link #addListener(Listener)} and {@link #removeListener(Listener)} instead.
...@@ -1275,6 +1277,10 @@ public interface Player { ...@@ -1275,6 +1277,10 @@ public interface Player {
/** /**
* Registers a listener to receive all events from the player. * Registers a listener to receive all events from the player.
* *
* <p>The listener's methods will be called on the thread that was used to construct the player.
* However, if the thread used to construct the player does not have a {@link Looper}, then the
* listener will be called on the main thread.
*
* @param listener The listener to register. * @param listener The listener to register.
*/ */
void addListener(Listener listener); void addListener(Listener listener);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment