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

Commit 921f9bdb authored by Taran Singh's avatar Taran Singh
Browse files

Fix stylus hover inits InkWindow

InkWindow is init first time handwriing capable IME is binded but never after that. We should set the
initializer after every bind so that we can init the InkWindow for
next stylus onHover.

Fixing this should help with reducing initiation latency for both focused and unfocused editors.

Fix: 289119709
Bug: 287109569

Test: atest StylusHandwritingTest

Change-Id: Ic921b350525b6e6b35f5946e51e506d40e3ba335
parent 92c44a50
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -291,6 +291,10 @@ final class HandwritingModeController {
        reset(false /* reinitializing */);
    }

    void setInkWindowInitializer(Runnable inkWindowInitializer) {
        mInkWindowInitRunnable = inkWindowInitializer;
    }

    private void reset(boolean reinitializing) {
        if (mHandwritingEventReceiver != null) {
            mHandwritingEventReceiver.dispose();
+3 −0
Original line number Diff line number Diff line
@@ -2442,6 +2442,9 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                curInputMethodInfo != null && curInputMethodInfo.suppressesSpellChecker();
        final SparseArray<IAccessibilityInputMethodSession> accessibilityInputMethodSessions =
                createAccessibilityInputMethodSessions(mCurClient.mAccessibilitySessions);
        if (mBindingController.supportsStylusHandwriting() && hasSupportedStylusLocked()) {
            mHwController.setInkWindowInitializer(new InkWindowInitializer());
        }
        return new InputBindResult(InputBindResult.ResultCode.SUCCESS_WITH_IME_SESSION,
                session.mSession, accessibilityInputMethodSessions,
                (session.mChannel != null ? session.mChannel.dup() : null),