Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 622ea3be authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Reduce unnecessary redraw of wallpaper when switching orientation

In legacy transition, the wallpaper can change to invisible from:
ActivityRecord#onAnimationFinished -> onExitAnimationDone
-> hideWallpapers

Since shell transition no longer calls onAnimationFinished,
it usually relies on the next prepareSurface after the wallpaper
target finishes transition.

But when launching activity with orientation change, the display
transition will execute right after the open transition is done.
Then all windows are in transition and wallpaper will keep visible.

That causes wallpaper to receive a redraw request for new rotation.
But actually the wallpaper target is already invisible.

So
 1. Check isVisible instead of inTransition because everything
    is in transition for a display transition.
 2. As legacy transition, when committing invisible for the wallpaper
    target, request to hide wallpaper as well. Then with
    VisibleRequested=false, it won't be requested to redraw.

This also reduces the chance to update wallpaper offset with
inconsistent orientation because the wallpaper won't perform relayout
to change requested size.

Bug: 281973565
Bug: 283952978
Test: Launch landscape app from portrait home.
      There should not have "finishDrawing of orientation"
      for wallpaper. And the window frame of wallpaper
      in dumpsys should still be portrait.

Change-Id: Ib84b86784477684bf4a2cebeee70a61f98ae57a0
parent 61f4503d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment