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

Commit 3cd142b1 authored by Louis Chang's avatar Louis Chang
Browse files

Do not boost the dimmer if the adjacent TF is dimming

When showing two activities side-by-side with AE, it is possible
to have both two activities showing dialogs with dim. The dimmer
surface in the primary container should not be boost in that case.

Bug: 323083755
Test: steps on the bug
Change-Id: Ib625e8bde16e4f9729794d0dad99c82dce44f282
parent b23955e7
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ import android.window.TaskFragmentOrganizerToken;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.ProtoLog;
import com.android.internal.util.ToBooleanFunction;
import com.android.server.am.HostingRecord;
import com.android.server.pm.pkg.AndroidPackage;
import com.android.window.flags.Flags;
@@ -3025,11 +3026,17 @@ class TaskFragment extends WindowContainer<WindowContainer> {
            return false;
        }

        // boost if there's an Activity window that has FLAG_DIM_BEHIND flag.
        return forAllWindows(
        ToBooleanFunction<WindowState> getDimBehindWindow =
                (w) -> (w.mAttrs.flags & FLAG_DIM_BEHIND) != 0 && w.mActivityRecord != null
                        && w.mActivityRecord.isEmbedded() && (w.mActivityRecord.isVisibleRequested()
                        || w.mActivityRecord.isVisible()), true);
                        || w.mActivityRecord.isVisible());
        if (adjacentTf.forAllWindows(getDimBehindWindow, true)) {
            // early return if the adjacent Tf has a dimming window.
            return false;
        }

        // boost if there's an Activity window that has FLAG_DIM_BEHIND flag.
        return forAllWindows(getDimBehindWindow, true);
    }

    @Override