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

Commit 713036b6 authored by Nikolas Havrikov's avatar Nikolas Havrikov
Browse files

Move connectedness booleans into controller

This slightly changes the semantics of the call sites,
and thus warrants a more thorough review.

Bug: 205676419
Test: make
Change-Id: If494009ad161cd065de28550d241b6a2757ecdb1
parent 4deaaf58
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -144,10 +144,6 @@ final class InputMethodBindingController {
        return mHasConnection;
    }

    void setHasConnection(boolean hasConnection) {
        mHasConnection = hasConnection;
    }

    /**
     * Id obtained with {@link InputMethodInfo#getId()} for the input method that we are currently
     * connected to or in the process of connecting to.
@@ -261,10 +257,6 @@ final class InputMethodBindingController {
        return mVisibleBound;
    }

    void setVisibleBound(boolean visibleBound) {
        mVisibleBound = visibleBound;
    }

    /**
     * Used to bring IME service up to visible adjustment while it is being shown.
     */
@@ -405,14 +397,16 @@ final class InputMethodBindingController {

    @GuardedBy("mMethodMap")
    boolean bindCurrentInputMethodServiceVisibleConnectionLocked() {
        return bindCurrentInputMethodServiceLocked(mVisibleConnection,
        mVisibleBound = bindCurrentInputMethodServiceLocked(mVisibleConnection,
                IME_VISIBLE_BIND_FLAGS);
        return mVisibleBound;
    }

    @GuardedBy("mMethodMap")
    boolean bindCurrentInputMethodServiceMainConnectionLocked() {
        return bindCurrentInputMethodServiceLocked(mMainConnection,
        mHasConnection = bindCurrentInputMethodServiceLocked(mMainConnection,
                mImeConnectionBindFlags);
        return mHasConnection;
    }


+0 −6
Original line number Diff line number Diff line
@@ -559,10 +559,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        return mBindingController.hasConnection();
    }

    private void setHasConnection(boolean hasConnection) {
        mBindingController.setHasConnection(hasConnection);
    }

    boolean isShowRequested() {
        return mShowRequested;
    }
@@ -2531,7 +2527,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        Binder token = new Binder();
        setCurToken(token);
        setLastBindTime(SystemClock.uptimeMillis());
        setHasConnection(true);
        setCurId(methodId);
        mCurTokenDisplayId = displayIdToShowIme;
        try {
@@ -3152,7 +3147,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            mInputShown = true;
            if (hasConnection() && !isVisibleBound()) {
                mBindingController.bindCurrentInputMethodServiceVisibleConnectionLocked();
                setVisibleBound(true);
            }
            res = true;
        } else {