Moved the Perfetto flag check into SurfaceFlinger.
Having the flag check in Perfetto creates a dependency on the flags, which are currently not available in vendor. This prevents systems in vendor (such as Lyric) from using libtracing_perfetto.
The flag has been 100% enabled at this point (b/303199244), so Perfetto users don't have to worry anymore about the API not being enabled. That said, specific users can choose to do the flag check in their own scope to retain the ability to turn it off if needed, like SurfaceFlinger will now do with this CL.
Bug: 373924379
Change-Id: I761c6f0137c0301cfb8fbac942291863053ee1de
Flag: EXEMPT - moves an existing flag check to a different location
diff --git a/services/surfaceflinger/Android.bp b/services/surfaceflinger/Android.bp
index 71c779e..05f7d1b 100644
--- a/services/surfaceflinger/Android.bp
+++ b/services/surfaceflinger/Android.bp
@@ -67,6 +67,7 @@
"android.hardware.graphics.composer@2.2",
"android.hardware.graphics.composer@2.3",
"android.hardware.graphics.composer@2.4",
+ "android.os.flags-aconfig-cc-host",
"libbase",
"libbinder",
"libbinder_ndk",
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 220133d..bd33437 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -37,6 +37,7 @@
#include <android/hardware/configstore/1.1/types.h>
#include <android/native_window.h>
#include <android/os/IInputFlinger.h>
+#include <android_os.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/PermissionCache.h>
@@ -741,7 +742,10 @@
mBootFinished = true;
FlagManager::getMutableInstance().markBootCompleted();
- ::tracing_perfetto::registerWithPerfetto();
+ if (android::os::perfetto_sdk_tracing()) {
+ ::tracing_perfetto::registerWithPerfetto();
+ }
+
mInitBootPropsFuture.wait();
mRenderEnginePrimeCacheFuture.wait();