Refactored how initial content capture events are sent.

The overall workflow of Content Capture is:
 - send initial structure
 - send deltas afterwards

Initially, the initial structure was being reported one view at time, which was causing janking.
This CL changes it so while that while the initial structure is being laid out, the content captures
are held. Then after it's finished, it traverses the structure and sends the initial events.

This change also allowed use to optimize the performance by caching the following state:
 - View.isImportantForContentCapture()
 - View.getContentCaptureSession()
 - Context.getContentCaptureManager()

Besides the performance improvements, this approach also has the following advantanges:
- It sends the VIEW_APPEARED events for the parent views before the events for the children.
- It send events to notify when the view structure layout is ready.

Bug: 123307965
Test: atest CtsContentCaptureServiceTestCases
Test: m update-api

Change-Id: I6db7cc11c6edf65cbffe42187fda82c84c3665ff
13 files changed