tracinglib: deprecate nameCoroutine, fix bugs
For performance, CoroutineTraceName no longer extends
CopyableThreadContextElement. This is to reduce the number of times
copy() is called. CopyableThreadContextElement would also prevent
optimal operator fusion from occurring in flows.
Mark `.nameCoroutine()` as deprecated, since it should only be used
in a few situations.
Add calls for `.stateInTraced`, `.shareInTrace`, etc.
Fix bug where trace sections could be written to the wrong thread-local
storage, leading to missing trace sections on resumption.
Also,
- Update demo app
- Add flow tracing tutorial
- Simplify flow operator fusion tracing calls
Test: Build and install CoroutineTracingDemoApp
Flag: com.android.systemui.coroutine_tracing
Bug: 383660219
Bug: 334171711
Bug: 381583986
Bug: 383660219
Bug: 350657545
Change-Id: Ia9280ac19362f24de70dce5f52a747f1fded85cb
33 files changed