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

Commit e7183f78 authored by Daniel Norman's avatar Daniel Norman Committed by Android (Google) Code Review
Browse files

Merge "cleanup: clean up flag update_corner_radius_on_display_changed" into main

parents bf97c653 3e408ba3
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -72,16 +72,6 @@ flag {
    bug: "379760792"
}

flag {
    name: "update_corner_radius_on_display_changed"
    namespace: "accessibility"
    description: "Updates the corner radius to the magnification fullscreen border when the display changes."
    bug: "335113174"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "update_window_magnifier_bottom_boundary"
    namespace: "accessibility"
+6 −15
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ import androidx.annotation.UiThread;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.policy.ScreenDecorationsUtils;
import com.android.systemui.Flags;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.res.R;
import com.android.systemui.util.leak.RotationUtils;
@@ -283,9 +282,7 @@ public class FullscreenMagnificationController implements ComponentCallbacks {
    void cleanUpBorder() {
        mContext.unregisterComponentCallbacks(this);

        if (Flags.updateCornerRadiusOnDisplayChanged()) {
        mDisplayManager.unregisterDisplayListener(mDisplayListener);
        }

        if (mSurfaceControlViewHost != null) {
            mSurfaceControlViewHost.release();
@@ -357,9 +354,7 @@ public class FullscreenMagnificationController implements ComponentCallbacks {
            } catch (Exception e) {
                Log.w(TAG, "Failed to register rotation watcher", e);
            }
            if (Flags.updateCornerRadiusOnDisplayChanged()) {
            applyCornerRadiusToBorder();
            }
            // A new SurfaceControl was created, so attachment is necessary.
            mShouldAttachOverlay = true;
        }
@@ -387,9 +382,7 @@ public class FullscreenMagnificationController implements ComponentCallbacks {
                mShouldAttachOverlay = false;
            }
        }
        if (Flags.updateCornerRadiusOnDisplayChanged()) {
        mDisplayManager.registerDisplayListener(mDisplayListener, mHandler);
        }

        applyTouchableRegion();
    }
@@ -447,12 +440,10 @@ public class FullscreenMagnificationController implements ComponentCallbacks {
            final int newWidth = mWindowBounds.width() + 2 * mBorderOffset;
            final int newHeight = mWindowBounds.height() + 2 * mBorderOffset;
            mSurfaceControlViewHost.relayout(newWidth, newHeight);
            if (Flags.updateCornerRadiusOnDisplayChanged()) {
            // Recenter the border
            mTransaction.setPosition(
                    mBorderSurfaceControl, -mBorderOffset, -mBorderOffset).apply();
        }
        }

        // Rotating from Landscape to ReverseLandscape will not trigger the config changes in
        // CONFIG_SCREEN_SIZE and CONFIG_ORIENTATION. Therefore, we would like to check the device
+0 −4
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import android.graphics.Rect;
import android.graphics.drawable.GradientDrawable;
import android.hardware.display.DisplayManager;
import android.os.RemoteException;
import android.platform.test.annotations.EnableFlags;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.Display;
@@ -53,7 +52,6 @@ import android.window.InputTransferToken;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;

import com.android.systemui.Flags;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.res.R;

@@ -218,7 +216,6 @@ public class FullscreenMagnificationControllerTest extends SysuiTestCase {
        verify(mSurfaceControlViewHost).relayout(newWidth, newHeight);
    }

    @EnableFlags(Flags.FLAG_UPDATE_CORNER_RADIUS_ON_DISPLAY_CHANGED)
    @Test
    public void enableFullscreenMagnification_applyPrimaryCornerRadius()
            throws InterruptedException {
@@ -229,7 +226,6 @@ public class FullscreenMagnificationControllerTest extends SysuiTestCase {
        assertThat(backgroundDrawable.getCornerRadius()).isEqualTo(CORNER_RADIUS_PRIMARY);
    }

    @EnableFlags(Flags.FLAG_UPDATE_CORNER_RADIUS_ON_DISPLAY_CHANGED)
    @Test
    public void onDisplayChanged_applyCornerRadiusToBorder() throws InterruptedException {
        enableFullscreenMagnificationAndWaitForTransactionAndAnimation();