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

Commit 0d29f424 authored by Yohei Yukawa's avatar Yohei Yukawa Committed by Android (Google) Code Review
Browse files

Merge "Merge synchronized blocks in IMM#hideSoftInputFromView()" into main

parents cd0821cd a41d7596
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -2463,12 +2463,12 @@ public final class InputMethodManager {
    public boolean hideSoftInputFromView(@NonNull View view, @HideFlags int flags) {
        final boolean isFocusedAndWindowFocused = view.hasWindowFocus() && view.isFocused();
        synchronized (mH) {
            if (!isFocusedAndWindowFocused && !hasServedByInputMethodLocked(view)) {
            final boolean hasServedByInputMethod = hasServedByInputMethodLocked(view);
            if (!isFocusedAndWindowFocused && !hasServedByInputMethod) {
                // Fail early if the view is not focused and not served
                // to avoid logging many erroneous calls.
                return false;
            }
        }

            final int reason = SoftInputShowHideReason.HIDE_SOFT_INPUT_FROM_VIEW;
            final var statsToken = ImeTracker.forLogging().onStart(ImeTracker.TYPE_HIDE,
@@ -2477,8 +2477,8 @@ public final class InputMethodManager {
                    ImeTracker.ORIGIN_CLIENT, reason, ActivityThread::currentApplication);
            ImeTracing.getInstance().triggerClientDump("InputMethodManager#hideSoftInputFromView",
                    this, null /* icProto */);
        synchronized (mH) {
            if (!hasServedByInputMethodLocked(view)) {

            if (!hasServedByInputMethod) {
                ImeTracker.forLogging().onFailed(statsToken, ImeTracker.PHASE_CLIENT_VIEW_SERVED);
                ImeTracker.forLatency().onShowFailed(statsToken,
                        ImeTracker.PHASE_CLIENT_VIEW_SERVED, ActivityThread::currentApplication);