From a1586de21f6c9191b99d2f3c815fcd15c48114e1 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Tue, 2 Apr 2019 16:32:58 -0700 Subject: [RESTRICT AUTOMERGE] SurfaceFlinger: Indicate whether we have captured secure layers. For purposes of the screen rotation animation the system server is allowed to capture secure (not protected) layers and trusted not to persist screenshots which may contain secure layers. However when displaying the screen rotation animation, the layer the screenshot is placed on will itself not be secure, so if we record the animation the recording will contain persisted versions of the secure content. Here we forward whether the screenshot contains secure content so that system server can do the right thing. Bug: b/69703445 Test: Transaction_test#SetFlagsSecureEUidSystem Change-Id: If493a39257b5e15410360a3df23f3e0fc8cf295c --- libs/gui/SurfaceComposerClient.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libs/gui/SurfaceComposerClient.cpp') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 263c7ef9e0..100257629e 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -768,11 +768,12 @@ status_t SurfaceComposerClient::getHdrCapabilities(const sp& display, status_t ScreenshotClient::capture(const sp& display, Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, int32_t minLayerZ, int32_t maxLayerZ, bool useIdentityTransform, uint32_t rotation, - bool captureSecureLayers, sp* outBuffer) { + bool captureSecureLayers, sp* outBuffer, + bool& outCapturedSecureLayers) { sp s(ComposerService::getComposerService()); if (s == NULL) return NO_INIT; - status_t ret = s->captureScreen(display, outBuffer, sourceCrop, reqWidth, reqHeight, minLayerZ, - maxLayerZ, useIdentityTransform, + status_t ret = s->captureScreen(display, outBuffer, outCapturedSecureLayers, sourceCrop, + reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform, static_cast(rotation), captureSecureLayers); if (ret != NO_ERROR) { @@ -785,8 +786,9 @@ status_t ScreenshotClient::capture(const sp& display, Rect sourceCrop, uint32_t reqHeight, int32_t minLayerZ, int32_t maxLayerZ, bool useIdentityTransform, uint32_t rotation, sp* outBuffer) { + bool ignored; return capture(display, sourceCrop, reqWidth, reqHeight, - minLayerZ, maxLayerZ, useIdentityTransform, rotation, false, outBuffer); + minLayerZ, maxLayerZ, useIdentityTransform, rotation, false, outBuffer, ignored); } status_t ScreenshotClient::captureLayers(const sp& layerHandle, Rect sourceCrop, -- cgit v1.2.3-59-g8ed1b