Skip to content

Commit b7a1a99

Browse files
committed
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 91b33f1)
1 parent 8f68b1a commit b7a1a99

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

services/surfaceflinger/Scheduler/Scheduler.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@ void Scheduler::onHdcpLevelsChanged(Cycle cycle, PhysicalDisplayId displayId,
426426
eventThreadFor(cycle).onHdcpLevelsChanged(displayId, connectedLevel, maxLevel);
427427
}
428428

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

447449
return isPacesetter;
448450
}
451+
#pragma clang diagnostic pop
449452

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

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

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

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

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

0 commit comments

Comments
 (0)