diff --git a/RELEASENOTES.md b/RELEASENOTES.md index caa9829f04..6c94ec1d86 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -6,6 +6,10 @@ * Fix bug where streams with highly uneven durations may get stuck in a buffering state ([#7943](https://github.com/google/ExoPlayer/issues/7943)). + * Verify correct thread usage in `SimpleExoPlayer` by default. Opt-out is + still possible until the next major release using + `setThrowsWhenUsingWrongThread(false)` + ([#4463](https://github.com/google/ExoPlayer/issues/4463)). * Track selection: * Add option to specify multiple preferred audio or text languages. * Data sources: 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 6652cbb03d..dd41d8e2bc 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 @@ -618,6 +618,7 @@ public class SimpleExoPlayer extends BasePlayer audioVolume = 1; audioSessionId = C.AUDIO_SESSION_ID_UNSET; currentCues = Collections.emptyList(); + throwsWhenUsingWrongThread = true; // Build the player and associated objects. player = @@ -1948,7 +1949,7 @@ public class SimpleExoPlayer extends BasePlayer * Sets whether the player should throw an {@link IllegalStateException} when methods are called * from a thread other than the one associated with {@link #getApplicationLooper()}. * - *

The default is {@code false}, but will change to {@code true} in the future. + *

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. */