Loading power/aidl/vts/VtsHalPowerTargetTest.cpp +36 −4 Original line number Diff line number Diff line Loading @@ -122,10 +122,16 @@ class PowerAidl : public testing::TestWithParam<std::string> { power = IPower::fromBinder(ndk::SpAIBinder(binder)); auto status = power->getInterfaceVersion(&mServiceVersion); ASSERT_TRUE(status.isOk()); if (mServiceVersion >= 2) { status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &mSession); mSessionSupport = status.isOk(); } } std::shared_ptr<IPower> power; int32_t mServiceVersion; std::shared_ptr<IPowerHintSession> mSession; bool mSessionSupport = false; }; class HintSessionAidl : public PowerAidl { Loading @@ -135,12 +141,11 @@ class HintSessionAidl : public PowerAidl { if (mServiceVersion < 2) { GTEST_SKIP() << "DEVICE not launching with Power V2 and beyond."; } auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &mSession); ASSERT_TRUE(status.isOk()); if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } ASSERT_NE(nullptr, mSession); } std::shared_ptr<IPowerHintSession> mSession; }; class FMQAidl : public PowerAidl { Loading Loading @@ -239,6 +244,9 @@ TEST_P(PowerAidl, isBoostSupported) { } TEST_P(PowerAidl, getHintSessionPreferredRate) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 2) { GTEST_SKIP() << "DEVICE not launching with Power V2 and beyond."; } Loading @@ -250,6 +258,9 @@ TEST_P(PowerAidl, getHintSessionPreferredRate) { } TEST_P(PowerAidl, createHintSessionWithConfig) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 5) { GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; } Loading @@ -271,6 +282,9 @@ TEST_P(PowerAidl, hasFixedPerformance) { } TEST_P(HintSessionAidl, createAndCloseHintSession) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } ASSERT_TRUE(mSession->pause().isOk()); ASSERT_TRUE(mSession->resume().isOk()); // Test normal destroy operation Loading @@ -279,6 +293,9 @@ TEST_P(HintSessionAidl, createAndCloseHintSession) { } TEST_P(HintSessionAidl, createHintSessionFailed) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } std::shared_ptr<IPowerHintSession> session; auto status = power->createHintSession(getpid(), getuid(), kEmptyTids, 16666666L, &session); Loading @@ -288,11 +305,17 @@ TEST_P(HintSessionAidl, createHintSessionFailed) { } TEST_P(HintSessionAidl, updateAndReportDurations) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } ASSERT_TRUE(mSession->updateTargetWorkDuration(16666667LL).isOk()); ASSERT_TRUE(mSession->reportActualWorkDuration(kDurations).isOk()); } TEST_P(HintSessionAidl, sendSessionHint) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 4) { GTEST_SKIP() << "DEVICE not launching with Power V4 and beyond."; } Loading @@ -306,6 +329,9 @@ TEST_P(HintSessionAidl, sendSessionHint) { } TEST_P(HintSessionAidl, setThreads) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 4) { GTEST_SKIP() << "DEVICE not launching with Power V4 and beyond."; } Loading @@ -318,6 +344,9 @@ TEST_P(HintSessionAidl, setThreads) { } TEST_P(HintSessionAidl, setSessionMode) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 5) { GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; } Loading @@ -333,6 +362,9 @@ TEST_P(HintSessionAidl, setSessionMode) { } TEST_P(HintSessionAidl, getSessionConfig) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 5) { GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; } Loading Loading
power/aidl/vts/VtsHalPowerTargetTest.cpp +36 −4 Original line number Diff line number Diff line Loading @@ -122,10 +122,16 @@ class PowerAidl : public testing::TestWithParam<std::string> { power = IPower::fromBinder(ndk::SpAIBinder(binder)); auto status = power->getInterfaceVersion(&mServiceVersion); ASSERT_TRUE(status.isOk()); if (mServiceVersion >= 2) { status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &mSession); mSessionSupport = status.isOk(); } } std::shared_ptr<IPower> power; int32_t mServiceVersion; std::shared_ptr<IPowerHintSession> mSession; bool mSessionSupport = false; }; class HintSessionAidl : public PowerAidl { Loading @@ -135,12 +141,11 @@ class HintSessionAidl : public PowerAidl { if (mServiceVersion < 2) { GTEST_SKIP() << "DEVICE not launching with Power V2 and beyond."; } auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &mSession); ASSERT_TRUE(status.isOk()); if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } ASSERT_NE(nullptr, mSession); } std::shared_ptr<IPowerHintSession> mSession; }; class FMQAidl : public PowerAidl { Loading Loading @@ -239,6 +244,9 @@ TEST_P(PowerAidl, isBoostSupported) { } TEST_P(PowerAidl, getHintSessionPreferredRate) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 2) { GTEST_SKIP() << "DEVICE not launching with Power V2 and beyond."; } Loading @@ -250,6 +258,9 @@ TEST_P(PowerAidl, getHintSessionPreferredRate) { } TEST_P(PowerAidl, createHintSessionWithConfig) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 5) { GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; } Loading @@ -271,6 +282,9 @@ TEST_P(PowerAidl, hasFixedPerformance) { } TEST_P(HintSessionAidl, createAndCloseHintSession) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } ASSERT_TRUE(mSession->pause().isOk()); ASSERT_TRUE(mSession->resume().isOk()); // Test normal destroy operation Loading @@ -279,6 +293,9 @@ TEST_P(HintSessionAidl, createAndCloseHintSession) { } TEST_P(HintSessionAidl, createHintSessionFailed) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } std::shared_ptr<IPowerHintSession> session; auto status = power->createHintSession(getpid(), getuid(), kEmptyTids, 16666666L, &session); Loading @@ -288,11 +305,17 @@ TEST_P(HintSessionAidl, createHintSessionFailed) { } TEST_P(HintSessionAidl, updateAndReportDurations) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } ASSERT_TRUE(mSession->updateTargetWorkDuration(16666667LL).isOk()); ASSERT_TRUE(mSession->reportActualWorkDuration(kDurations).isOk()); } TEST_P(HintSessionAidl, sendSessionHint) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 4) { GTEST_SKIP() << "DEVICE not launching with Power V4 and beyond."; } Loading @@ -306,6 +329,9 @@ TEST_P(HintSessionAidl, sendSessionHint) { } TEST_P(HintSessionAidl, setThreads) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 4) { GTEST_SKIP() << "DEVICE not launching with Power V4 and beyond."; } Loading @@ -318,6 +344,9 @@ TEST_P(HintSessionAidl, setThreads) { } TEST_P(HintSessionAidl, setSessionMode) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 5) { GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; } Loading @@ -333,6 +362,9 @@ TEST_P(HintSessionAidl, setSessionMode) { } TEST_P(HintSessionAidl, getSessionConfig) { if (!mSessionSupport) { GTEST_SKIP() << "DEVICE not support Hint Session."; } if (mServiceVersion < 5) { GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; } Loading