tracing: Log more user-friendly warning when tracing is uninitialized

If tracing is uninitialized and the user tries to use it, log a more
helpful error message instead of crashing on a null pointer dereference
somewhere deep in the the codebase.

To avoid introducing null checks to hot code paths, we instead introduce
a fake tracing muxer/platform which will explicitly fail all operations.
These fake objects will be replaced with real ones at initialization
time.

We also add a perfetto::Tracing::IsInitialized query to check if tracing
was initialized or not.

Note that data sources and TRACE_EVENT trace points will still silently
act as if tracing is disabled if the client library hasn't been
initialized. This is by design to avoid races during initialization
where it can be hard to guarantee no TRACE_EVENT is encountered before
Perfetto is initialized.

Change-Id: Iba1424f7040dda4d04da7b84752b1f4ad3b4d3b2
diff --git a/Android.bp b/Android.bp
index 221cbb3..cdecf37 100644
--- a/Android.bp
+++ b/Android.bp
@@ -8159,6 +8159,7 @@
     "src/tracing/event_context.cc",
     "src/tracing/interceptor.cc",
     "src/tracing/internal/interceptor_trace_writer.cc",
+    "src/tracing/internal/tracing_muxer_fake.cc",
     "src/tracing/internal/tracing_muxer_impl.cc",
     "src/tracing/internal/track_event_internal.cc",
     "src/tracing/platform.cc",