From b921458e40a8785e80c720577588ee4646bb2f5c Mon Sep 17 00:00:00 2001 From: tonihei Date: Tue, 20 Apr 2021 16:04:39 +0100 Subject: [PATCH] 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 --- .../java/com/google/android/exoplayer2/SimpleExoPlayer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java b/library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java index d498483ebd..4e5aecf88a 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java @@ -1821,7 +1821,10 @@ public class SimpleExoPlayer extends BasePlayer *

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. + * @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) { this.throwsWhenUsingWrongThread = throwsWhenUsingWrongThread; }