summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2020-07-08 18:43:08 +0000
committer Steven Moreland <smoreland@google.com> 2020-07-09 17:07:03 +0000
commit85a9d3225ae03ec18205056caf5c5c0321941c0f (patch)
tree82e3ea707cbe05e56c4db759e35f3d3de37ef513
parent27174df9cc1e06fe062b6071384629d0c8a1b7a3 (diff)
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: libbinderthreadstateutils_test Change-Id: Iab84111c219af4fdf01f4fc74b9dbc4db8bc441d
-rw-r--r--libs/binderthreadstate/test.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/libs/binderthreadstate/test.cpp b/libs/binderthreadstate/test.cpp
index 68cc225057..44e2fd19b1 100644
--- a/libs/binderthreadstate/test.cpp
+++ b/libs/binderthreadstate/test.cpp
@@ -165,7 +165,6 @@ int server(size_t thisId, size_t otherId) {
android::ProcessState::self()->startThreadPool();
// HIDL
- setenv("TREBLE_TESTING_OVERRIDE", "true", true);
android::hardware::configureRpcThreadpool(1, true /*callerWillJoin*/);
sp<IHidlStuff> hidlServer = new HidlServer(thisId, otherId);
CHECK(OK == hidlServer->registerAsService(id2name(thisId).c_str()));
@@ -176,7 +175,7 @@ int server(size_t thisId, size_t otherId) {
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
- setenv("TREBLE_TESTING_OVERRIDE", "true", true);
+ android::hardware::details::setTrebleTestingOverride(true);
if (fork() == 0) {
prctl(PR_SET_PDEATHSIG, SIGHUP);
return server(kP1Id, kP2Id);