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

Commit 9f226ba4 authored by ryanlwlin's avatar ryanlwlin
Browse files

Fix InlineFilteringTest#testFiltering_filtersByPrefix

The window matrix of the embedded window is not updated if the second
host SurfaceView  doesn't have any offset. To esnure the window matrix
is up-to-date, we force to update the matrix when the embedded hierarchy
is initialized.

Bug: 229178859
Test: atest InlineFilteringTest#testFiltering_filtersByPrefix
      atest android.accessibilityservice.cts
Change-Id: Ib23af520fcbaa1788e3ef22a1086b90a0801375c
parent e4910105
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -140,9 +140,9 @@ class RemoteAccessibilityController {
        return mConnectionWrapper;
    }

    void setWindowMatrix(Matrix m) {
        // If the window matrix is identity or doesn't change, do nothing.
        if (m.isIdentity() || m.equals(mWindowMatrixForEmbeddedHierarchy)) {
    void setWindowMatrix(Matrix m, boolean force) {
        // If the window matrix doesn't change, do nothing.
        if (!force && m.equals(mWindowMatrixForEmbeddedHierarchy)) {
            return;
        }

+4 −4
Original line number Diff line number Diff line
@@ -848,7 +848,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
                }
            }
            applyTransactionOnVriDraw(surfaceUpdateTransaction);
            updateEmbeddedAccessibilityMatrix();
            updateEmbeddedAccessibilityMatrix(false);

            mSurfaceFrame.left = 0;
            mSurfaceFrame.top = 0;
@@ -1748,7 +1748,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
        mRemoteAccessibilityController.assosciateHierarchy(connection,
            getViewRootImpl().mLeashToken, getAccessibilityViewId());

        updateEmbeddedAccessibilityMatrix();
        updateEmbeddedAccessibilityMatrix(true);
    }

    private void notifySurfaceDestroyed() {
@@ -1776,7 +1776,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
        }
    }

    void updateEmbeddedAccessibilityMatrix() {
    void updateEmbeddedAccessibilityMatrix(boolean force) {
        if (!mRemoteAccessibilityController.connected()) {
            return;
        }
@@ -1790,7 +1790,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
        mTmpMatrix.setTranslate(mTmpRect.left, mTmpRect.top);
        mTmpMatrix.postScale(mScreenRect.width() / (float) mSurfaceWidth,
                mScreenRect.height() / (float) mSurfaceHeight);
        mRemoteAccessibilityController.setWindowMatrix(mTmpMatrix);
        mRemoteAccessibilityController.setWindowMatrix(mTmpMatrix, force);
    }

    @Override