[DO NOT MERGE] Fix regression for enter PIP when onUserLeaveHint

This was changed in ag/15886711, but it shouldn't be needed anymore as
for case we need to animate the close transition, isVisible() will stay
true until the app transition is finished. Otherwise we shouldn't need
to keep the surface as visible even if it is in the closing app list.

Without this fix, we may accidentally show the surface that has been
commited to be invisible, such as enter pip onUserLeaveHint.

Fix: 216145863
Test: manually verify with Google Meet.
Test: atest WmTests:ActivityRecordTests
(cherry picked from commit 0207f039d25eece5f04512bfc1198ef72e5c2e4f)
(cherry picked from commit 7cb001fda4b82459b97140a0982c7e6f726aaf6d)
Merged-In: Ib28651f5c4dc728d19f968adc56015836e307ef8
Change-Id: Ib28651f5c4dc728d19f968adc56015836e307ef8
2 files changed