Deferring visibility updates while applying WCT

The activity was relaunched twice when applying a WCT. The first
relaunch was due to windowing mode changes. The second relaunch was
due to orientation changes.

The issue was observed on freeform display when moving the freeform
tasks into split-screen. The orientation of the freefrom tasks were
changed from landscape to portrait when entering split-screen, which
caused the activity relaunch second time.

Deferring the visibility updates while applying WCT and just do it
once (if needed) after all of the changes in the WCT are done.

Bug: 191891601
Test: atest ActivityLifecycleLegacySplitScreenTests
Change-Id: I9a09e11c0ce87a2454a38cf9305f0f15d5399390
4 files changed