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

Skip to content
Commit 6fe7b075 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Set client invisible immediately for trampoline with window

Since shell transition moves "commit invisible" from transition
ready to transition finish. The relayout from a invisible-requested
client may still enter WindowState#relayoutVisibleWindow because
it is still client-visible.

If the client is a trampoline activity, then it will draw an
unnecessary frame because the client considers it needs to report
draw complete for the first traversal.

The flow:
1. Start activity A
   - Assume there is a starting window for it
2. A's onCreate starts activity B
   - Starting window is transferred from A to B
   - Schedule A to pause
3. A continues to resume and add its window, receive pause request
4. A completes paused
   - Resume B, set visibility to false for B
   - Assume starting window was drawn so trigger transition ready
5. A performs traversal by previous resume.
   - Relayout returns RELAYOUT_RES_FIRST_TIME if the
     client visibility ActivityRecord is true
   - ViewRootImpl executes reportNextDraw("first_relayout")

Note that it has no such problem if the trampoline activity finishes
itself right after starting next activity, because client will skip
adding window by the finishing state.

Bug: 277303796
Test: Launch an activity which starts another activity in
      its onCreate.
Change-Id: I4196056b7f6b6161b431cb80444c9d86fef9492a
parent b4a8a82f
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