Remove rankTaskLayersIfNeeded from oom-adjustment calculation
- Call invalidateTaskLayers only when leaf/non-leaf task is moved
(The original place updateTaskMovement was too noisy that it
may get called without position change, e.g. move top to top).
- Call rankTaskLayersIfNeeded directly if oom-adj will be updated.
- Post rankTaskLayersIfNeeded in invalidateTaskLayers to make sure
the rank is updated. E.g. in split-screen, switch focus between
primary and secondary task won't trigger oom-adj update. But if
there is a service triggers later, the updated rank can still be
applied. So the result is close to the original method that pulls
from OomAdjuster.
- Also fix if a task contains multiple activities, the layer rank
may be replaced to -1 by iterating the invisible activity in the
same task.
Bug: 159104503
Test: atest RootWindowContainerTests#testTaskLayerRank
Change-Id: I127c1204a287302ad37de73ef7c42e9940a16fb6
8 files changed