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

Commit 6d5b9daa authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ensure libpowermanager benchmarks always notify framework on return" into main

parents 2e077971 eefb6a4a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -70,12 +70,14 @@ static void runBenchmark(benchmark::State& state, microseconds delay, R (IPower:

    if (hal == nullptr) {
        ALOGV("Power HAL not available, skipping test...");
        state.SkipWithMessage("Power HAL unavailable");
        return;
    }

    ndk::ScopedAStatus ret = (*hal.*fn)(std::forward<Args1>(args1)...);
    if (ret.getExceptionCode() == binder::Status::EX_UNSUPPORTED_OPERATION) {
        ALOGV("Power HAL does not support this operation, skipping test...");
        state.SkipWithMessage("operation unsupported");
        return;
    }

@@ -97,6 +99,7 @@ static void runSessionBenchmark(benchmark::State& state, R (IPowerHintSession::*

    if (hal == nullptr) {
        ALOGV("Power HAL not available, skipping test...");
        state.SkipWithMessage("Power HAL unavailable");
        return;
    }

@@ -109,12 +112,14 @@ static void runSessionBenchmark(benchmark::State& state, R (IPowerHintSession::*

    if (session == nullptr) {
        ALOGV("Power HAL doesn't support session, skipping test...");
        state.SkipWithMessage("operation unsupported");
        return;
    }

    ndk::ScopedAStatus ret = (*session.*fn)(std::forward<Args1>(args1)...);
    if (ret.getExceptionCode() == binder::Status::EX_UNSUPPORTED_OPERATION) {
        ALOGV("Power HAL does not support this operation, skipping test...");
        state.SkipWithMessage("operation unsupported");
        return;
    }

@@ -163,6 +168,7 @@ static void BM_PowerHalAidlBenchmarks_createHintSession(benchmark::State& state)

    if (hal == nullptr) {
        ALOGV("Power HAL not available, skipping test...");
        state.SkipWithMessage("Power HAL unavailable");
        return;
    }

@@ -170,6 +176,7 @@ static void BM_PowerHalAidlBenchmarks_createHintSession(benchmark::State& state)
            hal->createHintSession(tgid, uid, threadIds, durationNanos, &appSession);
    if (ret.getExceptionCode() == binder::Status::EX_UNSUPPORTED_OPERATION) {
        ALOGV("Power HAL does not support this operation, skipping test...");
        state.SkipWithMessage("operation unsupported");
        return;
    }

+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ static void runBenchmark(benchmark::State& state, microseconds delay, Return<R>

    if (hal == nullptr) {
        ALOGV("Power HAL HIDL not available, skipping test...");
        state.SkipWithMessage("Power HAL unavailable");
        return;
    }