Skip to content
Commit dfe3da7a authored by Evan Rosky's avatar Evan Rosky
Browse files

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
parent 2a9d8df0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment