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

Commit 9686160b authored by ryanlwlin's avatar ryanlwlin
Browse files

Fix PerfUnitTest Regression

We send the accessibilityWindowAttribute while inputmethod window
changes the layout to full-screen mode, which could slow the the
performance.

To fixt it, we cache the attributes in ViewRootImpl to avoid
unncessary IPC connection

Bug: 239288414
Test: use forrest to rerun the test
Change-Id: I158236d79df51678fd168dc988fe565793ef4a09
parent 563b92d6
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -846,6 +846,8 @@ public final class ViewRootImpl implements ViewParent,

    private int mLastTransformHint = Integer.MIN_VALUE;

    private AccessibilityWindowAttributes mAccessibilityWindowAttributes;

    /**
     * A temporary object used so relayoutWindow can return the latest SyncSeqId
     * system. The SyncSeqId system was designed to work without synchronous relayout
@@ -1397,9 +1399,13 @@ public final class ViewRootImpl implements ViewParent,
        if (registered) {
            final AccessibilityWindowAttributes attributes = new AccessibilityWindowAttributes(
                    mWindowAttributes);
            if (!attributes.equals(mAccessibilityWindowAttributes)) {
                mAccessibilityWindowAttributes = attributes;
                mAccessibilityManager.setAccessibilityWindowAttributes(getDisplayId(),
                        mAttachInfo.mAccessibilityWindowId, attributes);
            }

        }
    }

    /**
@@ -10345,6 +10351,7 @@ public final class ViewRootImpl implements ViewParent,
                    != AccessibilityWindowInfo.UNDEFINED_WINDOW_ID;
            if (registered) {
                mAttachInfo.mAccessibilityWindowId = AccessibilityWindowInfo.UNDEFINED_WINDOW_ID;
                mAccessibilityWindowAttributes = null;
                mAccessibilityManager.removeAccessibilityInteractionConnection(mWindow);
            }
        }
+2 −5
Original line number Diff line number Diff line
@@ -146,12 +146,9 @@ public class AccessibilityWindowManager {
            if (getWindowTokenForUserAndWindowIdLocked(resolvedUserId, windowId) == null) {
                return;
            }
            final AccessibilityWindowAttributes currentAttrs = mWindowAttributes.get(windowId);
            if (currentAttrs == null || !currentAttrs.equals(attributes)) {
            mWindowAttributes.put(windowId, attributes);
            shouldComputeWindows = findWindowInfoByIdLocked(windowId) != null;
        }
        }
        if (shouldComputeWindows) {
            mWindowManagerInternal.computeWindowsForAccessibility(displayId);
        }