diff options
author | 2024-03-26 18:41:06 +0000 | |
---|---|---|
committer | 2024-05-07 17:04:53 +0000 | |
commit | 80fd68a08911b984fcfee6ad1960f9ff3bb6274d (patch) | |
tree | 979d0470f6443fa12707ea239ac708a394fdeabe /libs/input/PointerController.cpp | |
parent | 4058c39493498d4628b6693f0091b80eab78ac54 (diff) |
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
Diffstat (limited to 'libs/input/PointerController.cpp')
-rw-r--r-- | libs/input/PointerController.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp index f9dc5fac7e21..933a33eb8b0e 100644 --- a/libs/input/PointerController.cpp +++ b/libs/input/PointerController.cpp @@ -272,7 +272,10 @@ void PointerController::setSpots(const PointerCoords* spotCoords, const uint32_t if (it == mLocked.spotControllers.end()) { mLocked.spotControllers.try_emplace(displayId, displayId, mContext); } - mLocked.spotControllers.at(displayId).setSpots(outSpotCoords.data(), spotIdToIndex, spotIdBits); + bool skipScreenshot = mLocked.displaysToSkipScreenshot.find(displayId) != + mLocked.displaysToSkipScreenshot.end(); + mLocked.spotControllers.at(displayId).setSpots(outSpotCoords.data(), spotIdToIndex, spotIdBits, + skipScreenshot); } void PointerController::clearSpots() { @@ -352,6 +355,17 @@ void PointerController::setCustomPointerIcon(const SpriteIcon& icon) { mCursorController.setCustomPointerIcon(icon); } +void PointerController::setSkipScreenshot(int32_t displayId, bool skip) { + if (!mEnabled) return; + + std::scoped_lock lock(getLock()); + if (skip) { + mLocked.displaysToSkipScreenshot.insert(displayId); + } else { + mLocked.displaysToSkipScreenshot.erase(displayId); + } +} + void PointerController::doInactivityTimeout() { fade(Transition::GRADUAL); } |