public class WindowLayersController
extends Object
Controller for assigning layers to windows on the display.
This class encapsulates general algorithm for assigning layers and special rules that we need to
apply on top. The general algorithm goes through windows from bottom to the top and the higher
the window is, the higher layer is assigned. The final layer is equal to base layer +
adjustment from the order. This means that the window list is assumed to be ordered roughly by
the base layer (there are exceptions, e.g. due to keyguard and wallpaper and they need to be
handled with care, because they break the algorithm).
On top of the general algorithm we add special rules, that govern such amazing things as:
IME (which has higher base layer, but will be positioned above application windows)
docked/pinned windows (that need to be lifted above other application windows, including
animations)
dock divider (which needs to live above applications, but below IME)
replaced windows, which need to live above their normal level, because they anticipate
an animation.