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

Commit c4f7678f authored by Marzia Favaro's avatar Marzia Favaro Committed by Android (Google) Code Review
Browse files

Merge "Replace broken flag" into main

parents 40760203 8d4dd286
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ flag {
}

flag {
  name: "dimmer_refactor"
  name: "introduce_smoother_dimmer"
  namespace: "windowing_frontend"
  description: "Refactor dim to fix flickers"
  bug: "295291019"
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ import com.android.window.flags.Flags;
 */
public abstract class Dimmer {

    static final boolean DIMMER_REFACTOR = Flags.dimmerRefactor();
    static final boolean DIMMER_REFACTOR = Flags.introduceSmootherDimmer();

    /**
     * The {@link WindowContainer} that our Dims are bounded to. We may be dimming on behalf of the
+1 −2
Original line number Diff line number Diff line
@@ -199,7 +199,6 @@ import com.android.server.Watchdog;
import com.android.server.am.ActivityManagerService;
import com.android.server.am.AppTimeTracker;
import com.android.server.uri.NeededUriGrants;
import com.android.window.flags.Flags;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -3301,7 +3300,7 @@ class Task extends TaskFragment {
        // Once at the root task level, we want to check {@link #isTranslucent(ActivityRecord)}.
        // If true, we want to get the Dimmer from the level above since we don't want to animate
        // the dim with the Task.
        if (!isRootTask() || (Flags.dimmerRefactor() && isTranslucentAndVisible())
        if (!isRootTask() || (Dimmer.DIMMER_REFACTOR && isTranslucentAndVisible())
                || isTranslucent(null)) {
            return super.getDimmer();
        }
+1 −2
Original line number Diff line number Diff line
@@ -103,7 +103,6 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.ProtoLog;
import com.android.server.am.HostingRecord;
import com.android.server.pm.pkg.AndroidPackage;
import com.android.window.flags.Flags;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -210,7 +209,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
     */
    int mMinHeight;

    Dimmer mDimmer = Flags.dimmerRefactor()
    Dimmer mDimmer = Dimmer.DIMMER_REFACTOR
            ? new SmoothDimmer(this) : new LegacyDimmer(this);

    /** Apply the dim layer on the embedded TaskFragment. */
+8 −9
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import android.view.SurfaceSession;

import com.android.server.testutils.StubTransaction;
import com.android.server.wm.utils.MockAnimationAdapter;
import com.android.window.flags.Flags;

import org.junit.Before;
import org.junit.Test;
@@ -150,7 +149,7 @@ public class DimmerTests extends WindowTestsBase {
        mHost = new MockSurfaceBuildingContainer(mWm);
        mTransaction = spy(StubTransaction.class);
        mChild = new TestWindowContainer(mWm);
        if (Flags.dimmerRefactor()) {
        if (Dimmer.DIMMER_REFACTOR) {
            sTestAnimation = spy(new MockAnimationAdapter());
            mDimmer = new SmoothDimmer(mHost, new MockAnimationAdapterFactory());
        } else {
@@ -177,7 +176,7 @@ public class DimmerTests extends WindowTestsBase {

    @Test
    public void testDimBelowWithChildSurfaceCreatesSurfaceBelowChild_Smooth() {
        assumeTrue(Flags.dimmerRefactor());
        assumeTrue(Dimmer.DIMMER_REFACTOR);
        final float alpha = 0.7f;
        final int blur = 50;
        mHost.addChild(mChild, 0);
@@ -197,7 +196,7 @@ public class DimmerTests extends WindowTestsBase {

    @Test
    public void testDimBelowWithChildSurfaceCreatesSurfaceBelowChild_Legacy() {
        assumeFalse(Flags.dimmerRefactor());
        assumeFalse(Dimmer.DIMMER_REFACTOR);
        final float alpha = 0.7f;
        mHost.addChild(mChild, 0);
        mDimmer.adjustAppearance(mChild, alpha, 20);
@@ -212,7 +211,7 @@ public class DimmerTests extends WindowTestsBase {

    @Test
    public void testDimBelowWithChildSurfaceDestroyedWhenReset_Smooth() {
        assumeTrue(Flags.dimmerRefactor());
        assumeTrue(Dimmer.DIMMER_REFACTOR);
        mHost.addChild(mChild, 0);

        final float alpha = 0.8f;
@@ -232,7 +231,7 @@ public class DimmerTests extends WindowTestsBase {

    @Test
    public void testDimBelowWithChildSurfaceDestroyedWhenReset_Legacy() {
        assumeFalse(Flags.dimmerRefactor());
        assumeFalse(Dimmer.DIMMER_REFACTOR);
        mHost.addChild(mChild, 0);

        final float alpha = 0.8f;
@@ -292,7 +291,7 @@ public class DimmerTests extends WindowTestsBase {

    @Test
    public void testRemoveDimImmediately_Smooth() {
        assumeTrue(Flags.dimmerRefactor());
        assumeTrue(Dimmer.DIMMER_REFACTOR);
        mHost.addChild(mChild, 0);
        mDimmer.adjustAppearance(mChild, 1, 2);
        mDimmer.adjustRelativeLayer(mChild, -1);
@@ -312,7 +311,7 @@ public class DimmerTests extends WindowTestsBase {

    @Test
    public void testRemoveDimImmediately_Legacy() {
        assumeFalse(Flags.dimmerRefactor());
        assumeFalse(Dimmer.DIMMER_REFACTOR);
        mHost.addChild(mChild, 0);
        mDimmer.adjustAppearance(mChild, 1, 0);
        mDimmer.adjustRelativeLayer(mChild, -1);
@@ -332,7 +331,7 @@ public class DimmerTests extends WindowTestsBase {

    @Test
    public void testDimmerWithBlurUpdatesTransaction_Legacy() {
        assumeFalse(Flags.dimmerRefactor());
        assumeFalse(Dimmer.DIMMER_REFACTOR);
        mHost.addChild(mChild, 0);

        final int blurRadius = 50;