Move policy handling into ATM hierarchy [3/n]
Adds the core of "static" overrides in the form of a new
resolution step during configuration update.
The general concept of "static" overrides is that the overrides
specified at a particular hierarchy level represent intent rather
than the actual state (which is what full configuration is for).
This means that policy constraints must be applied without
modifying the override configuration.
During configuration update (the onConfigurationChange chain),
the hierarchy level, itself, will resolve the requested overrides
based on its policy and constraints and apply the *resolved*
overrides to the full configuration. This allows the hierarchy to
be intrinsically adaptive. An example of how this can be used is
letter-boxing. Instead of baking letter-boxed bounds into the
override config and trying to keep it up-to-date by computing and
setting bounds in every code-path that could effect the bounds, we
can set the requested override config to fills-parent (null bounds)
and the hierarchy update will keep the resolved bounds updated
accordingly.
This CL introduces the new stage in configuration resolution
resolveOverrideConfiguration(). This gets run in onConfigurationChange
to update a new member mResolvedOverrideConfiguration which is what
ultimately overrides the full and merged configuration. The resolved
overrides are also what get sent to window containers which will
hopefully allow us to more-easily pull more logic out of the wm
hierarchy. To make things clearer, overrideConfiguration has
been renamed to requestedOverrideConfiguration.
The purpose of this resolution step is 2-fold: One, it provides
an opportunity for a hierarchy level to modify its configuration
before propagating to children; and two it allows hierarchy levels
to apply "dynamic" policy without modifying the actual overrides.
This is important for coalescing policy computation into the
hierarchy instead of spread out among various entry-points.
Bug: 113900640
Test: go/wm-smoke. Also wm servicestests+wmtests
Change-Id: I59dc60ec748693ae00d248a5a3c9953744920791
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index c70f075..67657d0 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -119,7 +119,7 @@
mResizeMode = resizeMode;
mSupportsPictureInPicture = supportsPictureInPicture;
setController(controller);
- setBounds(getOverrideBounds());
+ setBounds(getRequestedOverrideBounds());
mTaskDescription = taskDescription;
// Tasks have no set orientation value (including SCREEN_ORIENTATION_UNSPECIFIED).
@@ -369,7 +369,7 @@
* the adjusted bounds's top.
*/
void alignToAdjustedBounds(Rect adjustedBounds, Rect tempInsetBounds, boolean alignBottom) {
- if (!isResizeable() || EMPTY.equals(getOverrideConfiguration())) {
+ if (!isResizeable() || EMPTY.equals(getRequestedOverrideConfiguration())) {
return;
}