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

Commit a1a9ae53 authored by Nikolas Havrikov's avatar Nikolas Havrikov
Browse files

Move clearing current method to controller

Bug: 205676419
Test: make
Change-Id: I11641791abbc4f24d97e2d371900a912c9b6ba41
parent 0dc20ab2
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -231,10 +231,6 @@ final class InputMethodBindingController {
        return mCurMethod;
    }

    void setCurMethod(@Nullable IInputMethod curMethod) {
        mCurMethod = curMethod;
    }

    /**
     * If not {@link Process#INVALID_UID}, then the UID of {@link #getCurIntent()}.
     */
@@ -242,10 +238,6 @@ final class InputMethodBindingController {
        return mCurMethodUid;
    }

    void setCurMethodUid(int curMethodUid) {
        mCurMethodUid = curMethodUid;
    }

    /**
     * Indicates whether {@link #getVisibleConnection} is currently in use.
     */
@@ -369,6 +361,12 @@ final class InputMethodBindingController {
        mService.clearClientSessionsLocked();
    }

    @GuardedBy("mMethodMap")
    void clearCurMethodLocked() {
        mCurMethod = null;
        mCurMethodUid = Process.INVALID_UID;
    }

    @GuardedBy("mMethodMap")
    private void removeCurrentTokenLocked() {
        int curTokenDisplayId = mService.getCurTokenDisplayId();
+2 −11
Original line number Diff line number Diff line
@@ -606,10 +606,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        return mBindingController.getCurMethod();
    }

    private void setCurMethod(@Nullable IInputMethod curMethod) {
        mBindingController.setCurMethod(curMethod);
    }

    /**
     * If not {@link Process#INVALID_UID}, then the UID of {@link #getCurIntent()}.
     */
@@ -617,10 +613,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        return mBindingController.getCurMethodUid();
    }

    private void setCurMethodUid(int curMethodUid) {
        mBindingController.setCurMethodUid(curMethodUid);
    }

    /**
     * Time that we last initiated a bind to the input method, to determine
     * if we should try to disconnect and reconnect to it.
@@ -2598,9 +2590,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub

            finishSessionLocked(mEnabledSession);
            mEnabledSession = null;
            setCurMethod(null);
            setCurMethodUid(Process.INVALID_UID);
            scheduleNotifyImeUidToAudioService(getCurMethodUid());
            mBindingController.clearCurMethodLocked();
            scheduleNotifyImeUidToAudioService(Process.INVALID_UID);
        }
        hideStatusBarIconLocked();
        mInFullscreenMode = false;