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

Commit 45a0f4d9 authored by Taran Singh's avatar Taran Singh Committed by Automerger Merge Worker
Browse files

Merge "Finish handwriting session for recents gesture" into tm-dev am: 4cff41a3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17144828

Change-Id: If17fc0bac172eb487945044b257ef2c72c447e29
parents 6080c8fe 4cff41a3
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ class IInputMethodWrapper extends IInputMethod.Stub
    private static final int DO_CAN_START_STYLUS_HANDWRITING = 100;
    private static final int DO_START_STYLUS_HANDWRITING = 110;
    private static final int DO_INIT_INK_WINDOW = 120;
    private static final int DO_FINISH_STYLUS_HANDWRITING = 130;

    final WeakReference<InputMethodServiceInternal> mTarget;
    final Context mContext;
@@ -263,6 +264,10 @@ class IInputMethodWrapper extends IInputMethod.Stub
                inputMethod.initInkWindow();
                return;
            }
            case DO_FINISH_STYLUS_HANDWRITING: {
                inputMethod.finishStylusHandwriting();
                return;
            }

        }
        Log.w(TAG, "Unhandled message code: " + msg.what);
@@ -427,4 +432,10 @@ class IInputMethodWrapper extends IInputMethod.Stub
    public void initInkWindow() {
        mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_INIT_INK_WINDOW));
    }

    @BinderThread
    @Override
    public void finishStylusHandwriting() {
        mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_FINISH_STYLUS_HANDWRITING));
    }
}
+10 −1
Original line number Diff line number Diff line
@@ -992,6 +992,15 @@ public class InputMethodService extends AbstractInputMethodService {
            mOnPreparedStylusHwCalled = true;
        }

        /**
         * {@inheritDoc}
         * @hide
         */
        @Override
        public void finishStylusHandwriting() {
            InputMethodService.this.finishStylusHandwriting();
        }

        /**
         * {@inheritDoc}
         */
@@ -2461,7 +2470,7 @@ public class InputMethodService extends AbstractInputMethodService {
        mHandwritingEventReceiver = null;
        mInkWindow.hide(false /* remove */);

        mPrivOps.finishStylusHandwriting(requestId);
        mPrivOps.resetStylusHandwriting(requestId);
        mOnPreparedStylusHwCalled = false;
        onFinishStylusHandwriting();
    }
+8 −0
Original line number Diff line number Diff line
@@ -414,4 +414,12 @@ public interface InputMethod {
        // intentionally empty
    }

    /**
     * Finish stylus handwriting session.
     * @hide
     */
    default void finishStylusHandwriting() {
        // intentionally empty
    }

}
+1 −1
Original line number Diff line number Diff line
@@ -43,5 +43,5 @@ oneway interface IInputMethodPrivilegedOperations {
    void notifyUserActionAsync();
    void applyImeVisibilityAsync(IBinder showOrHideInputToken, boolean setVisible);
    void onStylusHandwritingReady(int requestId, int pid);
    void finishStylusHandwriting(int requestId);
    void resetStylusHandwriting(int requestId);
}
+2 −2
Original line number Diff line number Diff line
@@ -416,13 +416,13 @@ public final class InputMethodPrivilegedOperations {
     * @param requestId
     */
    @AnyThread
    public void finishStylusHandwriting(int requestId) {
    public void resetStylusHandwriting(int requestId) {
        final IInputMethodPrivilegedOperations ops = mOps.getAndWarnIfNull();
        if (ops == null) {
            return;
        }
        try {
            ops.finishStylusHandwriting(requestId);
            ops.resetStylusHandwriting(requestId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
Loading