Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85a9d322 authored by Steven Moreland's avatar Steven Moreland
Browse files

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
parent 27174df9
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);