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

Commit e13ee8ca 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:...

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

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



Change-Id: I5c40bb12d6f99a7835130e38f6e22b9fa8ba5942
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ddc461be b29355fa
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -224,6 +224,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
@@ -3369,13 +3369,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;
@@ -3457,7 +3463,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
            return false;
        }

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