Do not interrupt controller thread without a good reason

Interrupting the main thread in particular may be dangerous
as the flag is not cleared after handling the current message.

#minor-release

PiperOrigin-RevId: 572259422
(cherry picked from commit 846117399f)
This commit is contained in:
tonihei 2023-10-10 08:34:13 -07:00 committed by Rohit Singh
parent 2ec24ac55f
commit 7254f5aca5

View file

@ -538,7 +538,7 @@ public class MediaController implements Player {
* controller.
*/
public static void releaseFuture(Future<? extends MediaController> controllerFuture) {
if (controllerFuture.cancel(/* mayInterruptIfRunning= */ true)) {
if (controllerFuture.cancel(/* mayInterruptIfRunning= */ false)) {
// Successfully canceled the Future. The controller will be released by MediaControllerHolder.
return;
}