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

Skip to content
Commit 7d5780c3 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Fix no-op traversal requested in traversal before layout

Commit f64e1343 (2652da82) eliminates the unconditional resize from
the first layout. But IME window may rely on the additional resize
to trigger the 3rd layout pass to compute its final size, otherwise
the height of navigation bar isn’t accounted for IME window.

The layout steps of initializing IME window:
a. Add root view (ViewRootImpl setView -> requestLayout).
b. Layout pass 1: apply window insets (WindowInsetsListener of
    InputMethodService ~ DecorView#updateColorViews
    -> addView (navigation bar background) -> requestLayout).
c. Layout pass 2: almost no-op because pass 1 cleared
   ViewRootImpl#mLayoutRequested (performLayout is called
   after dispatchApplyInsets).

So if pass 2 performs measure and layout correctly, the 3rd layout
pass is not needed. As the comment of the first place that clears
mLayoutRequested (in ViewRootImpl#performTraversals), the layout
request during traversal should be caught for performing next full
layout pass.

Fix: 147857963
Test: atest OnScreenPositionTest#testImeIsNotBehindNavBar

Change-Id: Ib9c116fb81cd41c2df30ab81c0f0594c489cebf9
parent bbc9afbc
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