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

Commit a9625d3b authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Simplify MSG_SET_ACTIVE handler

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

Bug: 234882948
Test: presubmit
Change-Id: I410fc54cd941eda13f25acd1aedf8778956091f3
parent d838e9f2
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -1116,15 +1116,20 @@ public final class InputMethodManager {
                        // Check focus again in case that "onWindowFocus" is called before
                        // handling this message.
                        final View servedView = getServedViewLocked();
                        if (servedView != null && canStartInput(servedView)) {
                            if (mCurRootView != null && mCurRootView.getImeFocusController()
                                    .checkFocus(mRestartOnNextWindowFocus, false)) {
                        if (servedView == null || !canStartInput(servedView)) {
                            return;
                        }
                        if (mCurRootView == null) {
                            return;
                        }
                        if (!mCurRootView.getImeFocusController().checkFocus(
                                mRestartOnNextWindowFocus, false)) {
                            return;
                        }
                        final int reason = active ? StartInputReason.ACTIVATED_BY_IMMS
                                : StartInputReason.DEACTIVATED_BY_IMMS;
                        startInputOnWindowFocusGainInternal(reason, null, 0, 0, 0);
                    }
                        }
                    }
                    return;
                }
                case MSG_SET_INTERACTIVE: {