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

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

Merge "Fix potential trace{Begin, End} mis-match issues in IMMS" into udc-dev

parents fb0356f7 2096e015
Loading
Loading
Loading
Loading
+46 −36
Original line number Diff line number Diff line
@@ -4549,6 +4549,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
    @BinderThread
    private void applyImeVisibility(IBinder token, IBinder windowToken, boolean setVisible,
            @Nullable ImeTracker.Token statsToken) {
        try {
            Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMMS.applyImeVisibility");
            synchronized (ImfLock.class) {
                if (!calledWithValidTokenLocked(token)) {
@@ -4556,13 +4557,16 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                            ImeTracker.PHASE_SERVER_APPLY_IME_VISIBILITY);
                    return;
                }
            final IBinder requestToken = mVisibilityStateComputer.getWindowTokenFrom(windowToken);
                final IBinder requestToken = mVisibilityStateComputer.getWindowTokenFrom(
                        windowToken);
                mVisibilityApplier.applyImeVisibility(requestToken, statsToken,
                        setVisible ? ImeVisibilityStateComputer.STATE_SHOW_IME
                                : ImeVisibilityStateComputer.STATE_HIDE_IME);
            }
        } finally {
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }
    }

    @BinderThread
    private void resetStylusHandwriting(int requestId) {
@@ -4632,6 +4636,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
    @BinderThread
    private void hideMySoftInput(@NonNull IBinder token, int flags,
            @SoftInputShowHideReason int reason) {
        try {
            Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMMS.hideMySoftInput");
            synchronized (ImfLock.class) {
                if (!calledWithValidTokenLocked(token)) {
@@ -4645,11 +4650,14 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                    Binder.restoreCallingIdentity(ident);
                }
            }
        } finally {
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }
    }

    @BinderThread
    private void showMySoftInput(@NonNull IBinder token, int flags) {
        try {
            Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMMS.showMySoftInput");
            synchronized (ImfLock.class) {
                if (!calledWithValidTokenLocked(token)) {
@@ -4664,8 +4672,10 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                    Binder.restoreCallingIdentity(ident);
                }
            }
        } finally {
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }
    }

    @VisibleForTesting
    ImeVisibilityApplier getVisibilityApplier() {