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
Loading
Please register or sign in to comment