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

Commit 8fab9530 authored by Taran Singh's avatar Taran Singh
Browse files

Dont finish handwriting inking was prepared for session

If handwriting is started on unfocused view, startInput and hence
finishInput would be called. If IME prepared handwriting inkWindow for
the session, dontattempt to finish handwriting.
This should help with improving latency on unfocused editors

Bug: 287109569
Test: atest StylusHandwritingTest
Change-Id: I28c206dd5ca1aafb257f6050379c159190ab3d60
parent ed4179c6
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1016,8 +1016,9 @@ public class InputMethodService extends AbstractInputMethodService {
            if (!mOnPreparedStylusHwCalled) {
                // prepare hasn't been called by Stylus HOVER.
                onPrepareStylusHandwriting();
                mOnPreparedStylusHwCalled = true;
            }
            // reset flag as it's not relevant after onStartStylusHandwriting().
            mOnPreparedStylusHwCalled = false;
            if (onStartStylusHandwriting()) {
                mPrivOps.onStylusHandwritingReady(requestId, Process.myPid());
            } else {
@@ -3089,7 +3090,8 @@ public class InputMethodService extends AbstractInputMethodService {
        mInputStarted = false;
        mStartedInputConnection = null;
        mCurCompletions = null;
        if (mInkWindow != null) {
        if (!mOnPreparedStylusHwCalled) {
            // If IME didn't prepare to show InkWindow for current handwriting session.
            finishStylusHandwriting();
        }
        // Back callback is typically unregistered in {@link #hideWindow()}, but it's possible