Change default of throwsWhenUsingWrongThread to true

Apps can still opt out for now, but this option will be removed in
the future.

Issue: #4463
PiperOrigin-RevId: 333489424
This commit is contained in:
tonihei 2020-09-24 12:37:02 +01:00 committed by kim-vde
parent a92ccb0184
commit 294ae10ef1
2 changed files with 6 additions and 1 deletions

View file

@ -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:

View file

@ -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()}.
*
* <p>The default is {@code false}, but will change to {@code true} 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.
*/