Only complete sync draw for visible window

Otherwise the sync may be finished too early if the client perform
relayout with View.INVISIBLE (e.g. the activity is stopping).

Besides, window manager service should only consider View.VISIBLE
as real visible.

Also change constant field from commit cf9955f to reduce conflict.

Bug: 240564946
Test: CloseImeAutoOpenWindowToHomeTest
Change-Id: I9a9868ba5a628b8fa7312380a5b1bb8148865f21
Merged-In: I9a9868ba5a628b8fa7312380a5b1bb8148865f21
2 files changed