From 4aa22af29dcc20801344d1af84b2a790aef29af9 Mon Sep 17 00:00:00 2001 From: Chavi Weingarten Date: Fri, 17 Nov 2023 19:37:07 +0000 Subject: Ensure sub-hierarchy screenshots inherit secure from parent. If a sub-hierarchy is screenshot that doesn't include the parent layer that had the secure flag, the screenshot request would not respect the secure flag. This is incorrect because we want to ensure secure flag remains on all children regardless of where in the hierarchy the screenshot is taken. Test: CaptureChildRespectsParentSecureFlag Test: CaptureOffscreenChildRespectsParentSecureFlag Test: LayerSnapshotTest#setSecureRootSnapshot Bug: 308662081 Change-Id: I13f19a7fa4b9e51da0aa097314f015fe1340fc54 --- services/surfaceflinger/SurfaceFlinger.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 644b6ef30e..da2a6e0cc3 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -8958,6 +8958,7 @@ SurfaceFlinger::getLayerSnapshotsForScreenshots(uint32_t rootLayerId, uint32_t u .genericLayerMetadataKeyMap = getGenericLayerMetadataKeyMap(), .skipRoundCornersWhenProtected = !getRenderEngine().supportsProtectedContent()}; + args.rootSnapshot.isSecure = mLayerLifecycleManager.isLayerSecure(rootLayerId); mLayerSnapshotBuilder.update(args); auto getLayerSnapshotsFn = -- cgit v1.2.3-59-g8ed1b