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

Commit 18364887 authored by Candice Lo's avatar Candice Lo Committed by Android (Google) Code Review
Browse files

Merge "fix(window magnification): Set the surface of SurfaceView black" into main

parents 7e072076 cfb4d8ec
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -3,6 +3,16 @@ container: "system"

# NOTE: Keep alphabetized to help limit merge conflicts from multiple simultaneous editors.

flag {
    name: "add_black_background_for_window_magnifier"
    namespace: "accessibility"
    description: "Set the background for SurfaceView in window magnification black."
    bug: "299981434"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "create_windowless_window_magnifier"
    namespace: "accessibility"
+6 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
            MagnificationConstants.SCALE_MAX_VALUE);
    private static final float A11Y_CHANGE_SCALE_DIFFERENCE = 1.0f;
    private static final float ANIMATION_BOUNCE_EFFECT_SCALE = 1.05f;
    private static final float[] COLOR_BLACK_ARRAY = {0f, 0f, 0f};
    private final SparseArray<Float> mMagnificationSizeScaleOptions = new SparseArray<>();

    private final Context mContext;
@@ -1019,6 +1020,11 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
        if (!mMirrorSurface.isValid()) {
            return;
        }
        // Set the surface of the SurfaceView to black to avoid users seeing the contents below the
        // magnifier when the mirrored surface has an alpha less than 1.
        if (Flags.addBlackBackgroundForWindowMagnifier()) {
            mTransaction.setColor(mMirrorSurfaceView.getSurfaceControl(), COLOR_BLACK_ARRAY);
        }
        mTransaction.show(mMirrorSurface)
                .reparent(mMirrorSurface, mMirrorSurfaceView.getSurfaceControl());
        modifyWindowMagnification(false);