Support independent seamless rotation with shell transition
With shell transition, the seamless windows will be unrotated with the start transaction of transition. And restore the transformation when the windows are drawn in new rotation after the start transaction. Though the final decision of animation style is up to shell side, it is fine to use seamless style for all target windows. Because if seamless rotation is rejected, it usually falls back to use a screenshot based animation. So if the target windows are not drawn too slow, it has no difference to the normal rotation animation. Just at least the condition in AsyncRotationController is more aggressive to adopt seamless style. The example of normal rotation: Assume that StatusBar=S, NavigationBar=N, ScreenDecorOverlay=O1, ScreenDecorOverlayBottom=O2 1. Transition is requested. 2. Select fade style for S and N. Select seamless style for O1 and O2. 3. Setup start transaction. Prepare alpha 0 for S and N. Prepare unrotate for O1 and O2. 4. O1 is redrawn, capture its draw transaction. 5. Shell receives onTransitionReady and applies start transaction. 6. AsyncRotationController receives the transaction committed callback. Restore the unrotate with the captured draw transaction. 7. O2 is redrawn, restore the unrotate directly. 8. S and N are redrawn, apply fade-in animation. 9. The rotation animation finishes. For seamless rotation, just S and N also use seamless style. Bug: 214324186 Test: atest TransitionTests#testDisplayRotationChange TransitionTests#testAppTransitionWithRotationChange Test: adb shell setprop persist.debug.shell_transit 1; reboot - Rotate display with a simple activity. - Rotate display with a seamless activity, e.g. camera. - Rotate display with a seamless activity and app overlays. - Start a landscape activity from a portrait activity. Change-Id: I1b35d280c1ef6d6c5fadc990ed5528d496d77d57
Loading
Please register or sign in to comment