comboctl-main: Catch getParsedDisplayFrame() exceptions and rethrow later
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
This commit is contained in:
parent
8d6171db49
commit
03a32f09cf
|
@ -395,7 +395,16 @@ suspend fun longPressRTButtonUntil(
|
||||||
rtNavigationContext.getParsedDisplayFrame(filterDuplicates = true)
|
rtNavigationContext.getParsedDisplayFrame(filterDuplicates = true)
|
||||||
}
|
}
|
||||||
} catch (e: TimeoutCancellationException) {
|
} catch (e: TimeoutCancellationException) {
|
||||||
|
// Timeout expired, and we got no new frame. Stop waiting
|
||||||
|
// for one and continue long-pressing the button. We might
|
||||||
|
// be on a screen that does not update on its own.
|
||||||
null
|
null
|
||||||
|
} catch (t: Throwable) {
|
||||||
|
// An exception that's not TimeoutCancellationException
|
||||||
|
// was thrown. Catch it, store it to rethrow it later,
|
||||||
|
// and end the long button press.
|
||||||
|
thrownDuringButtonPress = t
|
||||||
|
return@startLongButtonPress false
|
||||||
} ?: return@startLongButtonPress true
|
} ?: return@startLongButtonPress true
|
||||||
|
|
||||||
// It is possible that we got a parsed display frame very quickly.
|
// It is possible that we got a parsed display frame very quickly.
|
||||||
|
|
Loading…
Reference in a new issue