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
This commit is contained in:
tonihei 2023-10-10 08:34:13 -07:00 committed by Copybara-Service
parent 7009c53c79
commit 846117399f

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;
}