Loading core/java/android/window/flags/windowing_sdk.aconfig +10 −0 Original line number Original line 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 { flag { namespace: "windowing_sdk" namespace: "windowing_sdk" name: "fix_bal_reparent_existing_task" name: "fix_bal_reparent_existing_task" Loading services/core/java/com/android/server/wm/ConfigurationContainer.java +10 −3 Original line number Original line 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 * 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 * 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 * 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} * @return {@code true} if this container level uses bounds from parent level, or is * otherwise. * fullscreen. {@code false} otherwise. */ */ public boolean matchParentBounds() { 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(); return getResolvedOverrideBounds().isEmpty(); } } Loading services/core/java/com/android/server/wm/TaskFragment.java +8 −4 Original line number Original line Diff line number Diff line Loading @@ -3399,12 +3399,16 @@ class TaskFragment extends WindowContainer<WindowContainer> { @Override @Override boolean fillsParent() { boolean fillsParent() { if (!com.android.window.flags.Flags.refactorMatchParentBounds()) { // From the perspective of policy, we still want to report that this task fills parent // 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 // in fullscreen windowing mode even it doesn't match parent bounds because there // letterbox around its real content. // will be letterbox around its real content. return getWindowingMode() == WINDOWING_MODE_FULLSCREEN || matchParentBounds(); return getWindowingMode() == WINDOWING_MODE_FULLSCREEN || matchParentBounds(); } } return matchParentBounds(); } @Override @Override protected boolean onChildVisibleRequestedChanged(@Nullable WindowContainer child) { protected boolean onChildVisibleRequestedChanged(@Nullable WindowContainer child) { if (!super.onChildVisibleRequestedChanged(child)) return false; if (!super.onChildVisibleRequestedChanged(child)) return false; Loading services/core/java/com/android/server/wm/WindowContainer.java +7 −4 Original line number Original line 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 * lifecycle. A container may fill its parent but have no content in it, so it would be * equivalent to not existing. * equivalent to not existing. * * * TODO(b/409417223): Consolidate with {@link #matchParentBounds}. * TODO b/409417223 - remove this method and replace it with #matchParentBounds */ */ boolean fillsParentBounds() { boolean fillsParentBounds() { if (!com.android.window.flags.Flags.refactorMatchParentBounds()) { final int windowingMode = getWindowingMode(); final int windowingMode = getWindowingMode(); return windowingMode == WINDOWING_MODE_FULLSCREEN return windowingMode == WINDOWING_MODE_FULLSCREEN || (windowingMode != WINDOWING_MODE_PINNED && matchParentBounds()); || (windowingMode != WINDOWING_MODE_PINNED && matchParentBounds()); } } return matchParentBounds(); } /** /** * Returns true if this container or its children have content that fills it. * 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 Original line Diff line number Diff line Loading @@ -1036,6 +1036,7 @@ public class TaskFragmentTest extends WindowTestsBase { final TaskFragment tf = createTaskFragmentWithActivity(task); final TaskFragment tf = createTaskFragmentWithActivity(task); final ActivityRecord activity = tf.getTopMostActivity(); final ActivityRecord activity = tf.getTopMostActivity(); tf.setVisibleRequested(true); tf.setVisibleRequested(true); activity.visibleIgnoringKeyguard = true; tf.setOverrideOrientation(SCREEN_ORIENTATION_BEHIND); tf.setOverrideOrientation(SCREEN_ORIENTATION_BEHIND); // Should report the override orientation // Should report the override orientation Loading Loading
core/java/android/window/flags/windowing_sdk.aconfig +10 −0 Original line number Original line 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 { flag { namespace: "windowing_sdk" namespace: "windowing_sdk" name: "fix_bal_reparent_existing_task" name: "fix_bal_reparent_existing_task" Loading
services/core/java/com/android/server/wm/ConfigurationContainer.java +10 −3 Original line number Original line 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 * 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 * 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 * 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} * @return {@code true} if this container level uses bounds from parent level, or is * otherwise. * fullscreen. {@code false} otherwise. */ */ public boolean matchParentBounds() { 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(); return getResolvedOverrideBounds().isEmpty(); } } Loading
services/core/java/com/android/server/wm/TaskFragment.java +8 −4 Original line number Original line Diff line number Diff line Loading @@ -3399,12 +3399,16 @@ class TaskFragment extends WindowContainer<WindowContainer> { @Override @Override boolean fillsParent() { boolean fillsParent() { if (!com.android.window.flags.Flags.refactorMatchParentBounds()) { // From the perspective of policy, we still want to report that this task fills parent // 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 // in fullscreen windowing mode even it doesn't match parent bounds because there // letterbox around its real content. // will be letterbox around its real content. return getWindowingMode() == WINDOWING_MODE_FULLSCREEN || matchParentBounds(); return getWindowingMode() == WINDOWING_MODE_FULLSCREEN || matchParentBounds(); } } return matchParentBounds(); } @Override @Override protected boolean onChildVisibleRequestedChanged(@Nullable WindowContainer child) { protected boolean onChildVisibleRequestedChanged(@Nullable WindowContainer child) { if (!super.onChildVisibleRequestedChanged(child)) return false; if (!super.onChildVisibleRequestedChanged(child)) return false; Loading
services/core/java/com/android/server/wm/WindowContainer.java +7 −4 Original line number Original line 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 * lifecycle. A container may fill its parent but have no content in it, so it would be * equivalent to not existing. * equivalent to not existing. * * * TODO(b/409417223): Consolidate with {@link #matchParentBounds}. * TODO b/409417223 - remove this method and replace it with #matchParentBounds */ */ boolean fillsParentBounds() { boolean fillsParentBounds() { if (!com.android.window.flags.Flags.refactorMatchParentBounds()) { final int windowingMode = getWindowingMode(); final int windowingMode = getWindowingMode(); return windowingMode == WINDOWING_MODE_FULLSCREEN return windowingMode == WINDOWING_MODE_FULLSCREEN || (windowingMode != WINDOWING_MODE_PINNED && matchParentBounds()); || (windowingMode != WINDOWING_MODE_PINNED && matchParentBounds()); } } return matchParentBounds(); } /** /** * Returns true if this container or its children have content that fills it. * 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 Original line Diff line number Diff line Loading @@ -1036,6 +1036,7 @@ public class TaskFragmentTest extends WindowTestsBase { final TaskFragment tf = createTaskFragmentWithActivity(task); final TaskFragment tf = createTaskFragmentWithActivity(task); final ActivityRecord activity = tf.getTopMostActivity(); final ActivityRecord activity = tf.getTopMostActivity(); tf.setVisibleRequested(true); tf.setVisibleRequested(true); activity.visibleIgnoringKeyguard = true; tf.setOverrideOrientation(SCREEN_ORIENTATION_BEHIND); tf.setOverrideOrientation(SCREEN_ORIENTATION_BEHIND); // Should report the override orientation // Should report the override orientation Loading