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

Commit f019be7b authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Prepare to remove getDimmer

Since these changes:
I9d816c213d0cf7a7adc32ebbbf843e35ea734d47
I4723efbd6bd8fc3a6613970b244b1e69996a472a
I0eb887f5f75ad7ba3a60fb61ec2996114fccac7e

Activity windows always use the dimmer of Task.
Non-activity windows always use the dimmer of RootDisplayArea.

Bug: 435301249
Flag: com.android.window.flags.remove_get_dimmer
Test: TaskFragmentTest#testGetDimBounds
Change-Id: I92f56a8d177f9478f96aef46265aacfc60b7a8fa
parent 0d7a87f8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -11,6 +11,16 @@ flag {
    }
}

flag {
  name: "remove_get_dimmer"
  namespace: "windowing_frontend"
  description: "Clean up old usages of dimmer"
  bug: "435301249"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "release_all_transition_surfaces"
  namespace: "windowing_frontend"
+3 −1
Original line number Diff line number Diff line
@@ -811,12 +811,14 @@ public class DisplayArea<T extends WindowContainer> extends WindowContainer<T> {
     * DisplayArea that can be dimmed.
     */
    static class Dimmable extends DisplayArea<DisplayArea> {
        private final Dimmer mDimmer = new Dimmer(this);
        final Dimmer mDimmer = new Dimmer(this);

        Dimmable(WindowManagerService wms, Type type, String name, int featureId) {
            super(wms, type, name, featureId);
        }

        // It is replaced by WindowState#getDimController().
        @Deprecated
        @Override
        Dimmer getDimmer() {
            return mDimmer;
+1 −0
Original line number Diff line number Diff line
@@ -3335,6 +3335,7 @@ class Task extends TaskFragment {
        return "Task=" + mTaskId + (mName != null ? "(" + mName + ")" : "");
    }

    // It is replaced by WindowState#getDimController().
    @Deprecated
    @Override
    Dimmer getDimmer() {
+16 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
     */
    int mMinHeight;

    Dimmer mDimmer = new Dimmer(this);
    final Dimmer mDimmer = new Dimmer(this);

    /** Apply the dim layer on the embedded TaskFragment. */
    static final int EMBEDDED_DIM_AREA_TASK_FRAGMENT = 0;
@@ -3261,6 +3261,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
        return forAllWindows(getDimBehindWindow, true);
    }

    // It is replaced by WindowState#getDimController().
    @Deprecated
    @Override
    Dimmer getDimmer() {
@@ -3274,6 +3275,20 @@ class TaskFragment extends WindowContainer<WindowContainer> {

    /** Bounds to be used for dimming, as well as touch related tests. */
    void getDimBounds(@NonNull Rect out) {
        if (com.android.window.flags.Flags.removeGetDimmer()) {
            if (mIsEmbedded && isDimmingOnParentTask()) {
                // Return the task bounds if the dimmer is showing and should cover on the Task
                // (not just on this embedded TaskFragment).
                final Task task = getTask();
                if (task != null && task.mDimmer.hasDimState()) {
                    out.set(task.getBounds());
                    return;
                }
            }
            out.set(getBounds());
            return;
        }

        if (mDimmer.hasDimState()) {
            out.set(mDimmer.getDimBounds());
        } else {
+1 −0
Original line number Diff line number Diff line
@@ -3239,6 +3239,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        }, true /* traverseTopToBottom */);
    }

    // It is replaced by WindowState#getDimController().
    @Deprecated
    Dimmer getDimmer() {
        if (mParent == null) {
Loading