Does ScreenOrientationRule
need a try
block around its statement evaluation?
Current:
val orientationToRestore = defaultOrientation ?: getCurrentOrientation()
statement.evaluate()
onDevice().perform(setScreenOrientation(orientationToRestore))
Proposed:
val orientationToRestore = defaultOrientation ?: getCurrentOrientation()
try {
statement.evaluate()
} finally {
onDevice().perform(setScreenOrientation(orientationToRestore))
}