summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dominik Laskowski <domlaskowski@google.com> 2021-09-27 18:20:58 -0700
committer Dominik Laskowski <domlaskowski@google.com> 2021-10-01 15:07:29 -0700
commitb4ba8f5c269b6d82a09f779dc3336ece4c04c053 (patch)
treec890be2259d2554b920439e40504cb7cd36c16b2
parent187489657e13f5910961180af7aefb0f7c4c765a (diff)
SF: Fix -Wunused-but-set-variable
Soong appends -Wno-error=unused-but-set-variable, negating SF's -Werror. - The type and appId variables are VR remnants. - TimeStats::canAddNewAggregatedStats compared apples and oranges. Bug: 129481165 Test: No warnings on clean build Change-Id: I071e71148a269bf9ab9a5e930a775b4ae6564916
-rw-r--r--services/surfaceflinger/BufferLayerConsumer.cpp2
-rw-r--r--services/surfaceflinger/Layer.cpp14
-rw-r--r--services/surfaceflinger/TimeStats/TimeStats.cpp2
3 files changed, 2 insertions, 16 deletions
diff --git a/services/surfaceflinger/BufferLayerConsumer.cpp b/services/surfaceflinger/BufferLayerConsumer.cpp
index 96b22478ab..c79fa1104c 100644
--- a/services/surfaceflinger/BufferLayerConsumer.cpp
+++ b/services/surfaceflinger/BufferLayerConsumer.cpp
@@ -438,7 +438,7 @@ void BufferLayerConsumer::onDisconnect() {
}
void BufferLayerConsumer::onSidebandStreamChanged() {
- FrameAvailableListener* unsafeFrameAvailableListener = nullptr;
+ [[maybe_unused]] FrameAvailableListener* unsafeFrameAvailableListener = nullptr;
{
Mutex::Autolock lock(mFrameAvailableMutex);
unsafeFrameAvailableListener = mFrameAvailableListener.unsafe_get();
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 87afa222e8..57837d43f9 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -426,20 +426,6 @@ void Layer::prepareBasicGeometryCompositionState() {
void Layer::prepareGeometryCompositionState() {
const auto& drawingState{getDrawingState()};
-
- int type = drawingState.metadata.getInt32(METADATA_WINDOW_TYPE, 0);
- int appId = drawingState.metadata.getInt32(METADATA_OWNER_UID, 0);
- sp<Layer> parent = mDrawingParent.promote();
- if (parent.get()) {
- auto& parentState = parent->getDrawingState();
- const int parentType = parentState.metadata.getInt32(METADATA_WINDOW_TYPE, 0);
- const int parentAppId = parentState.metadata.getInt32(METADATA_OWNER_UID, 0);
- if (parentType > 0 && parentAppId > 0) {
- type = parentType;
- appId = parentAppId;
- }
- }
-
auto* compositionState = editCompositionState();
compositionState->geomBufferSize = getBufferSize(drawingState);
diff --git a/services/surfaceflinger/TimeStats/TimeStats.cpp b/services/surfaceflinger/TimeStats/TimeStats.cpp
index 7c1f21f9e4..bf2038b277 100644
--- a/services/surfaceflinger/TimeStats/TimeStats.cpp
+++ b/services/surfaceflinger/TimeStats/TimeStats.cpp
@@ -564,7 +564,7 @@ bool TimeStats::canAddNewAggregatedStats(uid_t uid, const std::string& layerName
layerRecords += record.second.stats.size();
}
- return mTimeStats.stats.size() < MAX_NUM_LAYER_STATS;
+ return layerRecords < MAX_NUM_LAYER_STATS;
}
void TimeStats::setPostTime(int32_t layerId, uint64_t frameNumber, const std::string& layerName,