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

Commit 60ff4b44 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Remove the dependency on IMM#isActive() from SearchView

Despite its name, InputMethodManager#isActive(View) internally aquires
IMM lock three times and may even trigger IME focus switching.

To make things simpler and more predictable,

  InputMethodManager#hasActiveInputConnectionInternal(View)

should be used instead.

The end result should be the same even with this commit.

Bug: 291826769
Test: atest CtsInputMethodTestCases:SearchViewTest
Change-Id: I0d061ac7c44650411eb49a2d2449482d4a2dce18
parent 33d74806
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2109,7 +2109,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
                return;
            }

            if (imm.isActive(this)) {
            if (imm.hasActiveInputConnection(this)) {
                // This means that SearchAutoComplete is already connected to the IME.
                // InputMethodManager#showSoftInput() is guaranteed to pass client-side focus check.
                mHasPendingShowSoftInputRequest = false;