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

Commit 42c6de0c authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Rename ImeFocusController#checkFocus() to #onScheduledCheckFocus()

Now that

  ImeFocusController#checkFocus()

is called only from ViewRootImpl to handle MSG_CHECK_FOCUS.

Hence, it would make much more sense to rename it to

  ImeFocusController#onScheduledCheckFocus().

with also inlining hard-coded parameters.

This is still mechanical refactoring.  There must be no observable
behavior change.

Bug: 234882948
Test: presubmit
Change-Id: I354acacb2d35d378ee7bc140ac7bc6311bfec156
parent 0135405e
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -108,10 +108,11 @@ public final class ImeFocusController {
    }

    /**
     * @see InputMethodManager#checkFocus()
     * @see ViewRootImpl#dispatchCheckFocus()
     */
    void checkFocus(boolean forceNewFocus, boolean startInput) {
        getImmDelegate().checkFocus(forceNewFocus, startInput, mViewRootImpl);
    @UiThread
    void onScheduledCheckFocus() {
        getImmDelegate().onScheduledCheckFocus(mViewRootImpl);
    }

    @UiThread
@@ -163,7 +164,7 @@ public final class ImeFocusController {
        void onPostWindowGainedFocus(View viewForWindowFocus,
                @NonNull WindowManager.LayoutParams windowAttribute);
        void onViewFocusChanged(@NonNull View view, boolean hasFocus);
        void checkFocus(boolean forceNewFocus, boolean startInput, ViewRootImpl viewRootImpl);
        void onScheduledCheckFocus(@NonNull ViewRootImpl viewRootImpl);
        void onViewDetachedFromWindow(View view, ViewRootImpl viewRootImpl);
        void onWindowDismissed(ViewRootImpl viewRootImpl);
    }
+1 −1
Original line number Diff line number Diff line
@@ -5718,7 +5718,7 @@ public final class ViewRootImpl implements ViewParent,
                    enqueueInputEvent(event, null, 0, true);
                } break;
                case MSG_CHECK_FOCUS: {
                    getImeFocusController().checkFocus(false, true);
                    getImeFocusController().onScheduledCheckFocus();
                } break;
                case MSG_CLOSE_SYSTEM_DIALOGS: {
                    if (mView != null) {
+2 −3
Original line number Diff line number Diff line
@@ -832,9 +832,8 @@ public final class InputMethodManager {
        }

        @Override
        public void checkFocus(boolean forceNewFocus, boolean startInput,
                ViewRootImpl viewRootImpl) {
            checkFocusInternal(forceNewFocus, startInput, viewRootImpl);
        public void onScheduledCheckFocus(@NonNull ViewRootImpl viewRootImpl) {
            checkFocusInternal(false, true, viewRootImpl);
        }

        @Override