fix(android): return from orientation once the display reports the rotation - #2356
Open
thymikee wants to merge 1 commit into
Open
fix(android): return from orientation once the display reports the rotation#2356thymikee wants to merge 1 commit into
thymikee wants to merge 1 commit into
Conversation
…tation `orientation` wrote accelerometer_rotation and user_rotation and returned at once, while the display rotated some time later. On the loaded CI emulator that takes seconds, and accessibility reads hang meanwhile: the Android smoke's `wait text landscape` right after `orientation landscape-left` got a helper request timeout and then no readable capture for its whole 10s budget, with the failed-step snapshot taken afterwards already in landscape (PR #2344, run 34025424834). The command now polls `dumpsys display` for mCurrentOrientation to match the requested rotation, up to 15s, before returning. A display that never gets there fails the command with the observed rotation instead of reporting success; a display that reports no rotation at all is left to the setting as before.
Size Report
Startup median (7 runs, lower is better):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Android
orientationwroteaccelerometer_rotationanduser_rotationand returned at once, while the display rotated some time later. On the loaded CI emulator that takes seconds, and accessibility reads hang meanwhile.Evidence: the Android Smoke on #2344, https://github.com/callstack/agent-device/actions/runs/34025424834.
wait text landscaperight afterorientation landscape-leftreportedwait_capture_stalledwith zero readable captures: the helper session request timed out at 5s, the one-shot fallback ran into the wait's deadline, and the failed-step snapshot taken right after was already in landscape (nodes 2400px wide). The rotation had landed; the wait's whole budget went to the transition.Change
setAndroidOrientationnow pollsdumpsys displayformCurrentOrientationto match the requested rotation, every 500ms up to 15s, before returning.mCurrentAppOrientation=SCREEN_ORIENTATION_NOSENSOR),orientation landscape-leftpreviously "succeeded" without rotating and now fails after 15s withobservedRotation: 0.mCurrentOrientationat all is left to the setting, as before.Validation
requestedRotation: 1, observedRotation: 0when it never does; leaves a display that reports nothing to the setting. Package suite 641 tests green; typecheck, oxlint, oxfmt, fallow clean.orientation landscape-left1s,mCurrentOrientation=1;orientation portrait1s,mCurrentOrientation=0.What this does not explain
The other Android Smoke failure family (the post-alert canary missing while the device is in landscape although
orientation portraithad been confirmed) is still open; #2350 adds the rotation evidence for it. This change removes the transition cost from the command that starts a rotation, which is also where a later flip would be visible if it is a delayed re-application.