Deprecate setThrowWhenUsingWrongThread.

This method shouldn't be used anymore since the thread enforcement
is the default already. We still keep it for now to ease the transition
for apps that use ExoPlayer on multiple threads and want to temporarily
disable the enforcement while the threading problems are fixed.

PiperOrigin-RevId: 369440789
This commit is contained in:
tonihei 2021-04-20 16:04:39 +01:00 committed by Oliver Woodman
parent 8a11875bd7
commit b921458e40

View File

@ -1821,7 +1821,10 @@ public class SimpleExoPlayer extends BasePlayer
* <p>The default is {@code true} and this method will be removed in the future. * <p>The default is {@code true} and this method will be removed in the future.
* *
* @param throwsWhenUsingWrongThread Whether to throw when methods are called from a wrong thread. * @param throwsWhenUsingWrongThread Whether to throw when methods are called from a wrong thread.
* @deprecated Disabling the enforcement can result in hard-to-detect bugs. Do not use this method
* except to ease the transition while wrong thread access problems are fixed.
*/ */
@Deprecated
public void setThrowsWhenUsingWrongThread(boolean throwsWhenUsingWrongThread) { public void setThrowsWhenUsingWrongThread(boolean throwsWhenUsingWrongThread) {
this.throwsWhenUsingWrongThread = throwsWhenUsingWrongThread; this.throwsWhenUsingWrongThread = throwsWhenUsingWrongThread;
} }