Update orientation before executing transition by starting window
The issue case only happens with splash starting window (new task),
and the activity is going to start in a different orientation.
Because usually updateOrientation() in this case is called from
activityPaused() of previous activity or attachApplication for
cold launch (both route to ensureVisibilityAndConfig). But the
starting window may be drawn before that, then the transition still
runs in old orientation and then runs another rotation animation.
Also use isReportedDrawn() to replace isVisible(). Because the
original usage is to handle the case back from a non-occluding
activity to an existing visible activity. Since the condition
doesn't depend on transition, it can work both for legacy and
shell transition.
Bug: 218659058
Test: atest com.android.server.wm.flicker.launch.OpenAppColdTest
Change-Id: I4ecf64a496cffb628deaded6fe8ab031d42005cb
3 files changed