Loading
Reset reusable SCVH on release
By removing its views and reseting to its initial state when the
reusable SCVH is about to (potentially) be returned to the pool.
Otherwise when re-acquired its old views may be shown for a couple of
frames especially if going from being used for a header to being used
for a handle, because the handle relayout is async.
This also prevents a caption view from being added to two different
SCVHs that resulted in an IllegalStateException.
Flag: com.android.window.flags.clear_reusable_scvh_on_release
Fix: 402974148
Fix: 432324168
Test: move desktop app to fullscreen - observe no caption flicker
(easier by adding a delay to the async relayout)
Test: verify these steps no longer cause a crash:
(1) Have two users, clear all tasks/desks
(2) Go to user B, open one app in desktop
(3) Switch to user A, open two apps in desktop
(4) (Optional, use when not reproducing) switch the order of the two
apps of user A, so bring the bottom one to top before the next
step
(5) Switch to user B
(6) Switch to user A (see crash or repeat 4-6 if unsuccessful)
Change-Id: I9c7351ff03e81f1902effa584127ef4aebeac184