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

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

Inline InputMethodBindingController#addFreshWindowToken()

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

Bug: 341179600
Test: presubmit
Change-Id: I2350ce50735e049b157e71a7809f8a675a562b7a
parent 7e6e69e8
Loading
Loading
Loading
Loading
+10 −17
Original line number Diff line number Diff line
@@ -443,7 +443,16 @@ final class InputMethodBindingController {
            mCurId = info.getId();
            mLastBindTime = SystemClock.uptimeMillis();

            addFreshWindowToken();
            final int displayIdToShowIme = mService.getDisplayIdToShowImeLocked();
            mCurToken = new Binder();
            mService.setCurTokenDisplayIdLocked(displayIdToShowIme);
            if (DEBUG) {
                Slog.v(TAG, "Adding window token: " + mCurToken + " for display: "
                        + displayIdToShowIme);
            }
            mWindowManagerInternal.addWindowToken(mCurToken,
                    WindowManager.LayoutParams.TYPE_INPUT_METHOD,
                    displayIdToShowIme, null /* options */);
            return new InputBindResult(
                    InputBindResult.ResultCode.SUCCESS_WAITING_IME_BINDING,
                    null, null, null, mCurId, mCurSeq, false);
@@ -470,22 +479,6 @@ final class InputMethodBindingController {
        return intent;
    }

    @GuardedBy("ImfLock.class")
    private void addFreshWindowToken() {
        int displayIdToShowIme = mService.getDisplayIdToShowImeLocked();
        mCurToken = new Binder();

        mService.setCurTokenDisplayIdLocked(displayIdToShowIme);

        if (DEBUG) {
            Slog.v(TAG, "Adding window token: " + mCurToken + " for display: "
                    + displayIdToShowIme);
        }
        mWindowManagerInternal.addWindowToken(mCurToken,
                WindowManager.LayoutParams.TYPE_INPUT_METHOD,
                displayIdToShowIme, null /* options */);
    }

    @GuardedBy("ImfLock.class")
    private void unbindMainConnection() {
        mContext.unbindService(mMainConnection);