summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2022-10-28 06:31:21 +0000
committer Vishnu Nair <vishnun@google.com> 2022-10-28 22:52:34 +0000
commit9d77a5cf9d05b87b547f139dedf50ccfbebb140e (patch)
tree78c2af43ec414e0a2e475acd29eb49ed2a23bb21 /services/surfaceflinger/SurfaceFlinger.cpp
parentbb26732f6fe79100bcf648461d9104a97967666f (diff)
SF: Use layer id for region sampling stop layer
Cleanup before layer refbase removal. We can lookup the stop layer by using a unique id. Bug: 238781169 Test: presubmit Change-Id: I33da6899adebc33c814656591f78187f08c53e80
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index cfebec70cb..8fefcb1a62 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1580,9 +1580,10 @@ status_t SurfaceFlinger::addRegionSamplingListener(const Rect& samplingArea,
// LayerHandle::getLayer promotes the layer object in a binder thread but we will not destroy
// the layer here since the caller has a strong ref to the layer's handle.
- // TODO (b/238781169): replace layer with layer id
- const wp<Layer> stopLayer = LayerHandle::getLayer(stopLayerHandle);
- mRegionSamplingThread->addListener(samplingArea, stopLayer, listener);
+ const sp<Layer> stopLayer = LayerHandle::getLayer(stopLayerHandle);
+ mRegionSamplingThread->addListener(samplingArea,
+ stopLayer ? stopLayer->getSequence() : UNASSIGNED_LAYER_ID,
+ listener);
return NO_ERROR;
}