From 9d77a5cf9d05b87b547f139dedf50ccfbebb140e Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Fri, 28 Oct 2022 06:31:21 +0000 Subject: 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 --- services/surfaceflinger/SurfaceFlinger.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') 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 stopLayer = LayerHandle::getLayer(stopLayerHandle); - mRegionSamplingThread->addListener(samplingArea, stopLayer, listener); + const sp stopLayer = LayerHandle::getLayer(stopLayerHandle); + mRegionSamplingThread->addListener(samplingArea, + stopLayer ? stopLayer->getSequence() : UNASSIGNED_LAYER_ID, + listener); return NO_ERROR; } -- cgit v1.2.3-59-g8ed1b