From ebce1ebaa08ecca318dac317c238831a866cf3f6 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 25 Jan 2022 11:55:39 -0800 Subject: Don't treat CancellationException as an error Test: N/A Bug: N/A Change-Id: Id3405688a14b8cce7b4aedafe2aae58dbfe0f5e8 --- emulator/src/com/android/tools/idea/device/DeviceView.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'emulator') diff --git a/emulator/src/com/android/tools/idea/device/DeviceView.kt b/emulator/src/com/android/tools/idea/device/DeviceView.kt index 5c0dcd3f07b..8279a2a1d74 100644 --- a/emulator/src/com/android/tools/idea/device/DeviceView.kt +++ b/emulator/src/com/android/tools/idea/device/DeviceView.kt @@ -66,6 +66,7 @@ import java.awt.event.MouseAdapter import java.awt.event.MouseEvent import java.awt.event.MouseEvent.BUTTON1 import java.awt.geom.AffineTransform +import java.util.concurrent.CancellationException import kotlin.math.min /** @@ -169,6 +170,9 @@ class DeviceView( }) deviceClient.startVideoDecoding(decoder) } + catch (_: CancellationException) { + // The view has been closed. + } catch (e: Throwable) { thisLogger().error("Failed to initialize the screen sharing agent", e) EventQueue.invokeLater { -- cgit v1.2.3