VTSHalPowerTarget.FMQAidl: Make sure session status OK before running test

While PowerHal version >= 5 but devices didn't support HintSession. We should skip the test. Otherwise, it would fail.

Merged-In: I0f757ab825020ded02c31231969e13f3375e47f3
Change-Id: I0f757ab825020ded02c31231969e13f3375e47f3
Test: atest VTSHalPowerTarget
Bug: 328330332
This commit is contained in:
Jimmy Shiu 2024-03-20 08:21:22 +00:00
parent 7371e370dc
commit d594e608c3

View file

@ -159,7 +159,10 @@ class FMQAidl : public PowerAidl {
auto status = auto status =
power->createHintSessionWithConfig(getpid(), getuid(), kSelfTids, 16666666L, power->createHintSessionWithConfig(getpid(), getuid(), kSelfTids, 16666666L,
SessionTag::OTHER, &mSessionConfig, &mSession); SessionTag::OTHER, &mSessionConfig, &mSession);
ASSERT_TRUE(status.isOk()); mSessionSupport = status.isOk();
if (!mSessionSupport) {
GTEST_SKIP() << "DEVICE not support Hint Session.";
}
ASSERT_NE(nullptr, mSession); ASSERT_NE(nullptr, mSession);
status = power->getSessionChannel(getpid(), getuid(), &mChannelConfig); status = power->getSessionChannel(getpid(), getuid(), &mChannelConfig);