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

Skip to content
Commit a9ae219b authored by Cosmin Băieș's avatar Cosmin Băieș
Browse files

Optimize scheduleShowImePostLayout

This adds various small improvements to the logic in
ImeInsetsSourceProvider for scheduleShowImePostLayout.

The mShowImeRunner is inlined, as there is no need for a runnable for
this code. This allows removing the duplicated isReadyToShowIme check.
The order of the checks in isReadyToShowIme is slightly tweaked to early
return in the most common cases (when no request is scheduled), as well
as now including the WindowContainer checks. This method is now renamed
to isScheduledAndReadyToShowIme, and checkShowImePostLayout is renamed
to checkAndStartShowImePostLayout, to reflect the actual behaviour.

The mIsImeLayoutDrawn property is removed, as this didn't actually allow
skipping the isReadyToShowIme check, nor protect agains re-entry.

The abortShowImePostLayout is called only when we actually abort (hide
while we have a scheduled and unhandled show), and no longer after
handling a show. The trace for showImePostLayout is also marked ended in
the abort, to avoid unfinished traces.

Bug: 332898042
Test: atest ImeInsetsSourceProviderTest
Change-Id: Id8e8560f961339574f53c95e81e41147eef276d8
parent 08df28f4
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