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

Commit f816289e authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clear handwriting delegation once its started" into udc-qpr-dev

parents 3ad7c27f b3ebbe58
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -235,6 +235,7 @@ final class HandwritingModeController {
    @Nullable
    HandwritingSession startHandwritingSession(
            int requestId, int imePid, int imeUid, IBinder focusedWindowToken) {
        clearPendingHandwritingDelegation();
        if (mHandwritingSurface == null) {
            Slog.e(TAG, "Cannot start handwriting session: Handwriting was not initialized.");
            return null;
+8 −2
Original line number Diff line number Diff line
@@ -3453,13 +3453,19 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
    @BinderThread
    @Override
    public void startStylusHandwriting(IInputMethodClient client) {
        startStylusHandwriting(client, false /* usesDelegation */);
    }

    private void startStylusHandwriting(IInputMethodClient client, boolean usesDelegation) {
        Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMMS.startStylusHandwriting");
        try {
            ImeTracing.getInstance().triggerManagerServiceDump(
                    "InputMethodManagerService#startStylusHandwriting");
            int uid = Binder.getCallingUid();
            synchronized (ImfLock.class) {
                if (!usesDelegation) {
                    mHwController.clearPendingHandwritingDelegation();
                }
                if (!canInteractWithImeLocked(uid, client, "startStylusHandwriting",
                        null /* statsToken */)) {
                    return;
@@ -3541,7 +3547,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
            return false;
        }

        startStylusHandwriting(client);
        startStylusHandwriting(client, true /* usesDelegation */);
        return true;
    }