Commit 63722564 authored by Mygod's avatar Mygod

Suppress cancellation exceptions

parent 6c9a428c
...@@ -69,6 +69,8 @@ class ScannerActivity : AppCompatActivity(), ImageAnalysis.Analyzer { ...@@ -69,6 +69,8 @@ class ScannerActivity : AppCompatActivity(), ImageAnalysis.Analyzer {
process { InputImage.fromMediaImage(mediaImage, image.imageInfo.rotationDegrees) }.also { process { InputImage.fromMediaImage(mediaImage, image.imageInfo.rotationDegrees) }.also {
if (it) imageAnalysis.clearAnalyzer() if (it) imageAnalysis.clearAnalyzer()
} }
} catch (_: CancellationException) {
return@launchWhenCreated
} catch (e: Exception) { } catch (e: Exception) {
return@launchWhenCreated Timber.w(e) return@launchWhenCreated Timber.w(e)
} finally { } finally {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment