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

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

Merge "Consolidate fillsParentBounds with matchParentBounds" into main

parents 64dbbb99 31c41f49
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -177,6 +177,16 @@ flag {
    }
}

flag {
    namespace: "windowing_sdk"
    name: "refactor_match_parent_bounds"
    description: "Consolidate fillsParentBounds with matchParentBounds."
    bug: "409417223"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    namespace: "windowing_sdk"
    name: "fix_bal_reparent_existing_task"
+10 −3
Original line number Diff line number Diff line
@@ -441,12 +441,19 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
     * Indicates whether this container chooses not to override any bounds from its parent, either
     * because it doesn't request to override them or the request is dropped during configuration
     * resolution. In this case, it will inherit the bounds of the first ancestor which specifies a
     * bounds subject to policy constraints.
     * bounds subject to policy constraints. Or this container is fullscreen windowingMode.
     *
     * @return {@code true} if this container level uses bounds from parent level. {@code false}
     *         otherwise.
     * @return {@code true} if this container level uses bounds from parent level, or is
     *         fullscreen. {@code false} otherwise.
     */
    public boolean matchParentBounds() {
        if (!com.android.window.flags.Flags.refactorMatchParentBounds()) {
            return getResolvedOverrideBounds().isEmpty();
        }

        final int windowingMode = getWindowingMode();
        if (windowingMode == WINDOWING_MODE_PINNED) return false;
        if (windowingMode == WINDOWING_MODE_FULLSCREEN) return true;
        return getResolvedOverrideBounds().isEmpty();
    }

+8 −4
Original line number Diff line number Diff line
@@ -3399,12 +3399,16 @@ class TaskFragment extends WindowContainer<WindowContainer> {

    @Override
    boolean fillsParent() {
        if (!com.android.window.flags.Flags.refactorMatchParentBounds()) {
            // From the perspective of policy, we still want to report that this task fills parent
        // in fullscreen windowing mode even it doesn't match parent bounds because there will be
        // letterbox around its real content.
            // in fullscreen windowing mode even it doesn't match parent bounds because there
            // will be letterbox around its real content.
            return getWindowingMode() == WINDOWING_MODE_FULLSCREEN || matchParentBounds();
        }

        return matchParentBounds();
    }

    @Override
    protected boolean onChildVisibleRequestedChanged(@Nullable WindowContainer child) {
        if (!super.onChildVisibleRequestedChanged(child)) return false;
+7 −4
Original line number Diff line number Diff line
@@ -1650,13 +1650,16 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
     * lifecycle. A container may fill its parent but have no content in it, so it would be
     * equivalent to not existing.
     *
     * TODO(b/409417223): Consolidate with {@link #matchParentBounds}.
     * TODO b/409417223 - remove this method and replace it with #matchParentBounds
     */
    boolean fillsParentBounds() {
        if (!com.android.window.flags.Flags.refactorMatchParentBounds()) {
            final int windowingMode = getWindowingMode();
            return windowingMode == WINDOWING_MODE_FULLSCREEN
                    || (windowingMode != WINDOWING_MODE_PINNED && matchParentBounds());
        }
        return matchParentBounds();
    }

    /**
     * Returns true if this container or its children have content that fills it.
+1 −0
Original line number Diff line number Diff line
@@ -1036,6 +1036,7 @@ public class TaskFragmentTest extends WindowTestsBase {
        final TaskFragment tf = createTaskFragmentWithActivity(task);
        final ActivityRecord activity = tf.getTopMostActivity();
        tf.setVisibleRequested(true);
        activity.visibleIgnoringKeyguard = true;
        tf.setOverrideOrientation(SCREEN_ORIENTATION_BEHIND);

        // Should report the override orientation