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: atest VtsVndkHidlBufferpoolV1_0TargetMultiTest VtsVndkHidlBufferpoolV2_0TargetMultiTest
Change-Id: I6e6b48796686098d63f09d965c3252140352d0d9
diff --git a/media/bufferpool/2.0/tests/multi.cpp b/media/bufferpool/2.0/tests/multi.cpp
index 68b6992..b40838e 100644
--- a/media/bufferpool/2.0/tests/multi.cpp
+++ b/media/bufferpool/2.0/tests/multi.cpp
@@ -215,7 +215,7 @@
} // anonymous namespace
int main(int argc, char** argv) {
- setenv("TREBLE_TESTING_OVERRIDE", "true", true);
+ android::hardware::details::setTrebleTestingOverride(true);
::testing::InitGoogleTest(&argc, argv);
int status = RUN_ALL_TESTS();
LOG(INFO) << "Test result = " << status;