Mark first frames in metrics properly

Such that we only set the flag in case window visibility actually
changes. There are a lot of other cases where we need to do a
window relayout which can lead to visible jank.

Test: FrameMetricsListenerTest, manual
Bug: 185902609
Change-Id: Ia09ce640f3a89bf9dd4ff0f4e4469e88a513709a
5 files changed