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

Commit b29355fa authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

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

parents f651d871 f816289e
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;
    }