Generalize change transition into WindowContainer
Created a SurfaceFreezer class which lives in WindowContainer and manages/will-manage per-container freezing (snapshots). This replaces the one-off change transition code. Change Transitions used to create its own temporary leash on initialization and that leash would be replaced/cleaned-up as soon as the animation leash was created. Now, the SurfaceFreezer creates the animation leash immediately and SurfaceAnimator can take a SurfaceFreezer instance when it starts an animation. At this point it will take the leash that was already created by the freezer and use that. This removes the messy reparenting/cleanup. To deal with this, though, leash callbacks into Animatable needed an extra stage: onLeashAnimationStarting. This is called when SurfaceAnimatior is actually starting to animate the leash. Next, DC.mChangingApps was converted to list of WindowContainers rather than ActivityRecords. Some of the existing change code was cleaned up (ie. there was some visibility stuff that doesn't make sense because changing apps are visible->visible) and some of the Activity-specific functions were generalized. For now, there are a couple things that use the top-activity for changing Tasks. The result of this means that windowing-mode change transition can now fully live at the Task level. This also should allow freezing at any hierarchy level which enables app-freezes that don't freeze the whole screen and potentially mixed seamless/snapshot-based rotations. Bug: 149490428 Test: existing tests pass. Manually open app in freeform and maximize/restore it. Change-Id: Ib32524ebbbb084a98442d3d035897306a11ee6c2 (cherry picked from commit e55b9e0f)
Loading
Please register or sign in to comment