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

Commit eb0d3bc0 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix accessibility window position information.

Since the position is now split up between WS and WSA, we need to
take both into account when calculating the window position.

Test: ViewTest, PermissionsHostTest, etc
Change-Id: I5d8396cee072316744cbb4a7e6585a820e808f60
Fixes: 70682698
parent 313d7e00
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -234,16 +234,7 @@ final class AccessibilityController {

    private static void populateTransformationMatrixLocked(WindowState windowState,
            Matrix outMatrix) {
        sTempFloats[Matrix.MSCALE_X] = windowState.mWinAnimator.mDsDx;
        sTempFloats[Matrix.MSKEW_Y] = windowState.mWinAnimator.mDtDx;
        sTempFloats[Matrix.MSKEW_X] = windowState.mWinAnimator.mDtDy;
        sTempFloats[Matrix.MSCALE_Y] = windowState.mWinAnimator.mDsDy;
        sTempFloats[Matrix.MTRANS_X] = windowState.mShownPosition.x;
        sTempFloats[Matrix.MTRANS_Y] = windowState.mShownPosition.y;
        sTempFloats[Matrix.MPERSP_0] = 0;
        sTempFloats[Matrix.MPERSP_1] = 0;
        sTempFloats[Matrix.MPERSP_2] = 1;
        outMatrix.setValues(sTempFloats);
        windowState.getTransformationMatrix(sTempFloats, outMatrix);
    }

    /**
+19 −0
Original line number Diff line number Diff line
@@ -4314,6 +4314,25 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        mWinAnimator.onAnimationFinished();
    }

    /**
     * Retrieves the current transformation matrix of the window, relative to the display.
     *
     * @param float9 A temporary array of 9 floats.
     * @param outMatrix Matrix to fill in the transformation.
     */
    void getTransformationMatrix(float[] float9, Matrix outMatrix) {
        float9[Matrix.MSCALE_X] = mWinAnimator.mDsDx;
        float9[Matrix.MSKEW_Y] = mWinAnimator.mDtDx;
        float9[Matrix.MSKEW_X] = mWinAnimator.mDtDy;
        float9[Matrix.MSCALE_Y] = mWinAnimator.mDsDy;
        float9[Matrix.MTRANS_X] = mSurfacePosition.x + mShownPosition.x;
        float9[Matrix.MTRANS_Y] = mSurfacePosition.y + mShownPosition.y;
        float9[Matrix.MPERSP_0] = 0;
        float9[Matrix.MPERSP_1] = 0;
        float9[Matrix.MPERSP_2] = 1;
        outMatrix.setValues(float9);
    }

    // TODO: Hack to work around the number of states AppWindowToken needs to access without having
    // access to its windows children. Need to investigate re-writing
    // {@link AppWindowToken#updateReportedVisibilityLocked} so this can be removed.