From 80fd68a08911b984fcfee6ad1960f9ff3bb6274d Mon Sep 17 00:00:00 2001 From: Arpit Singh Date: Tue, 26 Mar 2024 18:41:06 +0000 Subject: Hide touch indicators on mirrored displays if a secure window is present Utilise ISurfaceComposerClient::eSkipScreenshot to remove the tap indicators from mirrored displays when a secure window is present. End-to-end test will be added in an upcoming CL. Test: manual test & atest PointerChoreographerTest PointerControllerTest Bug: 325252005 Change-Id: I72a77b1a1b2c02a5e94f05e67d0cd39588086c81 --- libs/input/TouchSpotController.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libs/input/TouchSpotController.cpp') diff --git a/libs/input/TouchSpotController.cpp b/libs/input/TouchSpotController.cpp index 99952aa14904..530d54129791 100644 --- a/libs/input/TouchSpotController.cpp +++ b/libs/input/TouchSpotController.cpp @@ -40,12 +40,13 @@ namespace android { // --- Spot --- void TouchSpotController::Spot::updateSprite(const SpriteIcon* icon, float newX, float newY, - int32_t displayId) { + int32_t displayId, bool skipScreenshot) { sprite->setLayer(Sprite::BASE_LAYER_SPOT + id); sprite->setAlpha(alpha); sprite->setTransformationMatrix(SpriteTransformationMatrix(scale, 0.0f, 0.0f, scale)); sprite->setPosition(newX, newY); sprite->setDisplayId(displayId); + sprite->setSkipScreenshot(skipScreenshot); x = newX; y = newY; @@ -84,7 +85,7 @@ TouchSpotController::~TouchSpotController() { } void TouchSpotController::setSpots(const PointerCoords* spotCoords, const uint32_t* spotIdToIndex, - BitSet32 spotIdBits) { + BitSet32 spotIdBits, bool skipScreenshot) { #if DEBUG_SPOT_UPDATES ALOGD("setSpots: idBits=%08x", spotIdBits.value); for (BitSet32 idBits(spotIdBits); !idBits.isEmpty();) { @@ -116,7 +117,7 @@ void TouchSpotController::setSpots(const PointerCoords* spotCoords, const uint32 spot = createAndAddSpotLocked(id, mLocked.displaySpots); } - spot->updateSprite(&icon, x, y, mDisplayId); + spot->updateSprite(&icon, x, y, mDisplayId, skipScreenshot); } for (Spot* spot : mLocked.displaySpots) { -- cgit v1.2.3-59-g8ed1b