Fix various issues with offscreen touch zones
1) When touch zones were released, the ViewHost was being released, but not the root leash. Now the root leash is removed as well.
2) The swap animation was calculating the wrong end position for the divider, because it measured from the screen edge instead of accounting for the offscreen app's offset.
3) The touch layer was being animated while still active, meaning that if the surface passed under the user's finger, it would register a touch. Now the touch layer is deactivated and removed prior to animation.
Fixes: 391868062
Fixes: 391866253
Flag: com.android.wm.shell.enable_flexible_two_app_split
Test: App surfaces no longer jump cut when swapping on the right side, and winscope is clear of any extra leashes.
Change-Id: I37103658c9082cfa02a870cb8ab30d0baae7c04a
3 files changed