Loading core/java/android/window/flags/windowing_sdk.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -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" Loading services/core/java/com/android/server/wm/ConfigurationContainer.java +10 −3 Original line number Diff line number Diff line Loading @@ -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(); } Loading services/core/java/com/android/server/wm/TaskFragment.java +8 −4 Original line number Diff line number Diff line Loading @@ -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; Loading services/core/java/com/android/server/wm/WindowContainer.java +7 −4 Original line number Diff line number Diff line Loading @@ -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. Loading services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
core/java/android/window/flags/windowing_sdk.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -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" Loading
services/core/java/com/android/server/wm/ConfigurationContainer.java +10 −3 Original line number Diff line number Diff line Loading @@ -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(); } Loading
services/core/java/com/android/server/wm/TaskFragment.java +8 −4 Original line number Diff line number Diff line Loading @@ -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; Loading
services/core/java/com/android/server/wm/WindowContainer.java +7 −4 Original line number Diff line number Diff line Loading @@ -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. Loading
services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading