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