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

Commit 2c3b63f0 authored by jimmyshiu's avatar jimmyshiu Committed by Matt Buckley
Browse files

VTSHalPowerTarget: Add condition check for FMQAidl teardown

While FMQAidl Setup() was skipped, some uninitialized objects would be
used in FMQAidl Teardown() which caused the test failed.
Add some condition check to prevent from using uninitialized objects.

Test: atest VTSHalPowerTarget
Bug: 328330332
Change-Id: I83081cbef66da1d74d87e191f266cb16fb559b85
(cherry picked from commit d3753ec9)
parent acb80cfd
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -175,9 +175,13 @@ class FMQAidl : public PowerAidl {
        ASSERT_NE(mEventFlag, nullptr);
    }
    virtual void TearDown() {
        if (mSession) {
            mSession->close();
            if (mChannel->isValid()) {
                ASSERT_TRUE(power->closeSessionChannel(getpid(), getuid()).isOk());
            }
        }
    }

  protected:
    std::shared_ptr<IPowerHintSession> mSession;