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

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

Merge "Fix issue #70722141: Fix broken WindowTest.testSetLocalFocus"

parents 81265cf6 011944c7
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -327,6 +327,8 @@ public final class ViewRootImpl implements ViewParent,
    // This is used to reduce the race between window focus changes being dispatched from
    // the window manager and input events coming through the input system.
    @GuardedBy("this")
    boolean mWindowFocusChanged;
    @GuardedBy("this")
    boolean mUpcomingWindowFocus;
    @GuardedBy("this")
    boolean mUpcomingInTouchMode;
@@ -2472,14 +2474,14 @@ public final class ViewRootImpl implements ViewParent,
        final boolean hasWindowFocus;
        final boolean inTouchMode;
        synchronized (this) {
            if (!mWindowFocusChanged) {
                return;
            }
            mWindowFocusChanged = false;
            hasWindowFocus = mUpcomingWindowFocus;
            inTouchMode = mUpcomingInTouchMode;
        }

        if (mAttachInfo.mHasWindowFocus == hasWindowFocus) {
            return;
        }

        if (mAdded) {
            profileRendering(hasWindowFocus);

@@ -7181,6 +7183,7 @@ public final class ViewRootImpl implements ViewParent,

    public void windowFocusChanged(boolean hasFocus, boolean inTouchMode) {
        synchronized (this) {
            mWindowFocusChanged = true;
            mUpcomingWindowFocus = hasFocus;
            mUpcomingInTouchMode = inTouchMode;
        }