@@ -70,12 +70,14 @@ static void runBenchmark(benchmark::State& state, microseconds delay, R (IPower:
7070
7171 if (hal == nullptr ) {
7272 ALOGV (" Power HAL not available, skipping test..." );
73+ state.SkipWithMessage (" Power HAL unavailable" );
7374 return ;
7475 }
7576
7677 ndk::ScopedAStatus ret = (*hal.*fn)(std::forward<Args1>(args1)...);
7778 if (ret.getExceptionCode () == binder::Status::EX_UNSUPPORTED_OPERATION) {
7879 ALOGV (" Power HAL does not support this operation, skipping test..." );
80+ state.SkipWithMessage (" operation unsupported" );
7981 return ;
8082 }
8183
@@ -97,6 +99,7 @@ static void runSessionBenchmark(benchmark::State& state, R (IPowerHintSession::*
9799
98100 if (hal == nullptr ) {
99101 ALOGV (" Power HAL not available, skipping test..." );
102+ state.SkipWithMessage (" Power HAL unavailable" );
100103 return ;
101104 }
102105
@@ -109,12 +112,14 @@ static void runSessionBenchmark(benchmark::State& state, R (IPowerHintSession::*
109112
110113 if (session == nullptr ) {
111114 ALOGV (" Power HAL doesn't support session, skipping test..." );
115+ state.SkipWithMessage (" operation unsupported" );
112116 return ;
113117 }
114118
115119 ndk::ScopedAStatus ret = (*session.*fn)(std::forward<Args1>(args1)...);
116120 if (ret.getExceptionCode () == binder::Status::EX_UNSUPPORTED_OPERATION) {
117121 ALOGV (" Power HAL does not support this operation, skipping test..." );
122+ state.SkipWithMessage (" operation unsupported" );
118123 return ;
119124 }
120125
@@ -163,13 +168,15 @@ static void BM_PowerHalAidlBenchmarks_createHintSession(benchmark::State& state)
163168
164169 if (hal == nullptr ) {
165170 ALOGV (" Power HAL not available, skipping test..." );
171+ state.SkipWithMessage (" Power HAL unavailable" );
166172 return ;
167173 }
168174
169175 ndk::ScopedAStatus ret =
170176 hal->createHintSession (tgid, uid, threadIds, durationNanos, &appSession);
171177 if (ret.getExceptionCode () == binder::Status::EX_UNSUPPORTED_OPERATION) {
172178 ALOGV (" Power HAL does not support this operation, skipping test..." );
179+ state.SkipWithMessage (" operation unsupported" );
173180 return ;
174181 }
175182
0 commit comments