mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 06:22:53 +00:00
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
This commit is contained in:
@@ -180,8 +180,12 @@ class FMQAidl : public PowerAidl {
|
||||
ASSERT_NE(mEventFlag, nullptr);
|
||||
}
|
||||
virtual void TearDown() {
|
||||
mSession->close();
|
||||
ASSERT_TRUE(power->closeSessionChannel(getpid(), getuid()).isOk());
|
||||
if (mSession) {
|
||||
mSession->close();
|
||||
if (mChannel->isValid()) {
|
||||
ASSERT_TRUE(power->closeSessionChannel(getpid(), getuid()).isOk());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user