Improved how Content Capture events are flushed when activity is resumed / paused.

We were flushing right after the activity resumed, but the relevant events (views added / removed)
were not generated yet, which made such flushes useless.

This CL changes the workflow to flush them after the ViewRoot finishes doing its work.

Test: atest CtsContentCaptureServiceTestCases

Bug: 125395044
Bug: 122315042

Change-Id: I05bf27069b00c285643b2d23ad6708a6ad7bc8f3
5 files changed