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

Commit d549cc31 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "cleanup: clean up flag update_window_magnifier_bottom_boundary" into main

parents 5153bd40 93206865
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -72,16 +72,6 @@ flag {
    bug: "379760792"
}

flag {
    name: "update_window_magnifier_bottom_boundary"
    namespace: "accessibility"
    description: "Update the window magnifier boundary at the bottom to the top of the system gesture inset."
    bug: "380320995"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "update_window_magnifier_bottom_boundary_with_mouse"
    namespace: "accessibility"
+2 −3
Original line number Diff line number Diff line
@@ -1675,9 +1675,8 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
    }

    private boolean canOverlapWithBottomGestureInsets() {
        return !Flags.updateWindowMagnifierBottomBoundary()
                || (Flags.updateWindowMagnifierBottomBoundaryWithMouse()
                && mIsMouseOrKeyboardConnected);
        return Flags.updateWindowMagnifierBottomBoundaryWithMouse()
                && mIsMouseOrKeyboardConnected;
    }

    public void dump(PrintWriter pw) {
+0 −40
Original line number Diff line number Diff line
@@ -64,7 +64,6 @@ import android.hardware.input.InputManager;
import android.os.Handler;
import android.os.RemoteException;
import android.os.SystemClock;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
import android.provider.Settings;
import android.testing.TestableLooper;
@@ -461,27 +460,6 @@ public class WindowMagnificationControllerTest extends SysuiTestCase {
        assertThat(hasMagnificationOverlapFlag()).isFalse();
    }

    @Test
    @DisableFlags(Flags.FLAG_UPDATE_WINDOW_MAGNIFIER_BOTTOM_BOUNDARY)
    public void deleteWindowMagnification_enableAtTheBottom_overlapFlagIsFalse() {
        final WindowManager wm = mContext.getSystemService(WindowManager.class);
        final Rect bounds = wm.getCurrentWindowMetrics().getBounds();
        setSystemGestureInsets();

        mInstrumentation.runOnMainSync(() -> {
            mWindowMagnificationController.updateWindowMagnificationInternal(Float.NaN, Float.NaN,
                    bounds.bottom);
        });
        ReferenceTestUtils.waitForCondition(this::hasMagnificationOverlapFlag);

        mInstrumentation.runOnMainSync(() -> {
            mWindowMagnificationController.deleteWindowMagnification();
        });

        verify(mMirrorWindowControl).destroyControl();
        assertThat(hasMagnificationOverlapFlag()).isFalse();
    }

    @Test
    public void deleteWindowMagnification_notifySourceBoundsChanged() {
        mInstrumentation.runOnMainSync(
@@ -1283,23 +1261,6 @@ public class WindowMagnificationControllerTest extends SysuiTestCase {
        ReferenceTestUtils.waitForCondition(() -> hasMagnificationOverlapFlag());
    }

    @Test
    @DisableFlags(Flags.FLAG_UPDATE_WINDOW_MAGNIFIER_BOTTOM_BOUNDARY)
    public void moveWindowMagnificationToTheBottom_enabledWithGestureInset_overlapFlagIsTrue() {
        final Rect bounds = mWindowManager.getCurrentWindowMetrics().getBounds();
        setSystemGestureInsets();
        mInstrumentation.runOnMainSync(() -> {
            mWindowMagnificationController.updateWindowMagnificationInternal(Float.NaN, Float.NaN,
                    Float.NaN);
        });

        mInstrumentation.runOnMainSync(() -> {
            mWindowMagnificationController.moveWindowMagnifier(0, bounds.height());
        });

        ReferenceTestUtils.waitForCondition(() -> hasMagnificationOverlapFlag());
    }

    @Test
    @EnableFlags(Flags.FLAG_UPDATE_WINDOW_MAGNIFIER_BOTTOM_BOUNDARY_WITH_MOUSE)
    public void moveWindowMagnificationToTheBottom_withoutMouse_stopsAtSystemGestureTop() {
@@ -1336,7 +1297,6 @@ public class WindowMagnificationControllerTest extends SysuiTestCase {
    }

    @Test
    @EnableFlags(Flags.FLAG_UPDATE_WINDOW_MAGNIFIER_BOTTOM_BOUNDARY)
    public void moveWindowMagnificationToTheBottom_stopsAtSystemGestureTop() {
        final Rect bounds = mWindowManager.getCurrentWindowMetrics().getBounds();
        setSystemGestureInsets();