summaryrefslogtreecommitdiff
path: root/libs/input/PointerController.cpp
diff options
context:
space:
mode:
author Arpit Singh <arpitks@google.com> 2024-03-26 18:41:06 +0000
committer Arpit Singh <arpitks@google.com> 2024-05-30 12:35:51 +0000
commitf4ae0ac6f86e419b153c01917584262563a0531c (patch)
treee9a2112cd11e3395845c40c888681f1e8d5a5bdb /libs/input/PointerController.cpp
parenta5e3415216bdab85ce371b956a74e840a26f2b85 (diff)
Add method to set SkipScreenshot flag on cursorcontroller sprites
Add a methods to be able to set ISurfaceComposerClient::eSkipScreenshot flag on MouseCursorController. This will be used to hide mouse and stylus pointers on mirrored displays when a privacy sensitive window is present on source display. Test: manual test & atest PointerControllerTest Bug: 325252005 Change-Id: Ide428e8daf96a1d919adb9d6374a9ea738f87cc5
Diffstat (limited to 'libs/input/PointerController.cpp')
-rw-r--r--libs/input/PointerController.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp
index cca1b07c3118..11b27a214984 100644
--- a/libs/input/PointerController.cpp
+++ b/libs/input/PointerController.cpp
@@ -286,13 +286,16 @@ void PointerController::setCustomPointerIcon(const SpriteIcon& icon) {
mCursorController.setCustomPointerIcon(icon);
}
-void PointerController::setSkipScreenshot(ui::LogicalDisplayId displayId, bool skip) {
+void PointerController::setSkipScreenshotFlagForDisplay(ui::LogicalDisplayId displayId) {
std::scoped_lock lock(getLock());
- if (skip) {
- mLocked.displaysToSkipScreenshot.insert(displayId);
- } else {
- mLocked.displaysToSkipScreenshot.erase(displayId);
- }
+ mLocked.displaysToSkipScreenshot.insert(displayId);
+ mCursorController.setSkipScreenshot(true);
+}
+
+void PointerController::clearSkipScreenshotFlags() {
+ std::scoped_lock lock(getLock());
+ mLocked.displaysToSkipScreenshot.clear();
+ mCursorController.setSkipScreenshot(false);
}
void PointerController::doInactivityTimeout() {