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

Skip to content
Commit 7b5ae865 authored by Ming-Shin Lu's avatar Ming-Shin Lu
Browse files

Fix a potential NPE after scheduleShowImePostLayout

When IME control targets request showing IME,
ImeInsetsSourceProvider#scheduleShowImePostLayout will end up being
called to schedule showInsets with a runner in the next layout.

However, there is a timing that the target may be removed before the
runner invoked (e.g. force-stop the app), and seeing
"uncaught exception in WindowManager" log from
applySurfaceChangesTransaction. Even though the exception won't make the
system server crash, it's still a potential risk.

Add a check in isReadyToShowIme() to ensure the control target is ready
to call showInsets when exists.

Fix: 244715663
Test: run atest CtsInputMethodTestCases without seeing "uncaught
exception in WindowManager" log during force-stop test packages.
Test: atest ImeInsetsSourceProviderTest

Change-Id: I5327077c2e7292f508d5141125738be46400e5d0
parent 4a8abca2
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