Avoid TREBLE_TESTING_OVERRIDE
This is moved from an environmental variable to a function since
getenv is problematic in multi-threaded testing environments.
Bug: 156668058
Test: N/A (b/160796914)
Change-Id: I065a13e295b368150b1a4a1fc87faa2432ec359b
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 60b3cf0..c033290 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -55,6 +55,7 @@
#include <gui/IProducerListener.h>
#include <gui/LayerDebugInfo.h>
#include <gui/Surface.h>
+#include <hidl/ServiceManagement.h>
#include <input/IInputFlinger.h>
#include <renderengine/RenderEngine.h>
#include <ui/ColorSpace.h>
@@ -401,7 +402,7 @@
// deriving the setting from the set service name, but it
// would be brittle if the name that's not 'default' is used
// for production purposes later on.
- setenv("TREBLE_TESTING_OVERRIDE", "true", true);
+ android::hardware::details::setTrebleTestingOverride(true);
}
}