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

Commit b7a1a99f authored by Aditya Kumar's avatar Aditya Kumar
Browse files

Disable -Wunused-value for surfaceflinger

```
out/soong/.intermediates/frameworks/native/services/surfaceflinger/Tracing/tools/layertracegenerator/android_x86_64_silvermont/obj/frameworks/native/services/surfaceflinger/Scheduler/Scheduler.o frameworks/native/services/surfaceflinger/Scheduler/Scheduler.cpp
frameworks/native/services/surfaceflinger/Scheduler/Scheduler.cpp:432:29: error: ignoring temporary created by a constructor declared with 'nodiscard' attribute [-Werror,-Wunused-value]
  432 |                            (std::scoped_lock(mDisplayLock), displayId == mPacesetterDisplayId));
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Flag: EXEMPT b/369277774
Bug: b/369277774
Merged-In: Idd45525cc3fe15c3b5e66332650ce8b7811ae026
Change-Id: Idd45525cc3fe15c3b5e66332650ce8b7811ae026
(cherry picked from commit 91b33f18)
parent 8f68b1a6
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -426,6 +426,8 @@ void Scheduler::onHdcpLevelsChanged(Cycle cycle, PhysicalDisplayId displayId,
    eventThreadFor(cycle).onHdcpLevelsChanged(displayId, connectedLevel, maxLevel);
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value" // b/369277774
bool Scheduler::onDisplayModeChanged(PhysicalDisplayId displayId, const FrameRateMode& mode) {
    const bool isPacesetter =
            FTL_FAKE_GUARD(kMainThreadContext,
@@ -446,6 +448,7 @@ bool Scheduler::onDisplayModeChanged(PhysicalDisplayId displayId, const FrameRat

    return isPacesetter;
}
#pragma clang diagnostic pop

void Scheduler::emitModeChangeIfNeeded() {
    if (!mPolicy.modeOpt || !mPolicy.emittedModeOpt) {
@@ -483,6 +486,8 @@ void Scheduler::setDuration(Cycle cycle, std::chrono::nanoseconds workDuration,
    }
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value" // b/369277774
void Scheduler::updatePhaseConfiguration(PhysicalDisplayId displayId, Fps refreshRate) {
    const bool isPacesetter =
            FTL_FAKE_GUARD(kMainThreadContext,
@@ -494,6 +499,7 @@ void Scheduler::updatePhaseConfiguration(PhysicalDisplayId displayId, Fps refres
    setVsyncConfig(mVsyncModulator->setVsyncConfigSet(mVsyncConfiguration->getCurrentConfigs()),
                   refreshRate.getPeriod());
}
#pragma clang diagnostic pop

void Scheduler::setActiveDisplayPowerModeForRefreshRateStats(hal::PowerMode powerMode) {
    mRefreshRateStats->setPowerMode(powerMode);
@@ -909,6 +915,8 @@ void Scheduler::dumpVsync(std::string& out) const {
    }
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value" // b/369277774
void Scheduler::updateFrameRateOverrides(GlobalSignals consideredSignals, Fps displayRefreshRate) {
    const bool changed = (std::scoped_lock(mPolicyLock),
                          updateFrameRateOverridesLocked(consideredSignals, displayRefreshRate));
@@ -917,6 +925,7 @@ void Scheduler::updateFrameRateOverrides(GlobalSignals consideredSignals, Fps di
        onFrameRateOverridesChanged();
    }
}
#pragma clang diagnostic pop

bool Scheduler::updateFrameRateOverridesLocked(GlobalSignals consideredSignals,
                                               Fps displayRefreshRate) {