summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author chaviw <chaviw@google.com> 2022-03-08 11:07:01 -0600
committer chaviw <chaviw@google.com> 2022-03-16 11:24:05 -0500
commita2948adabd4a4895eee52cb2ddeae61bcf79f2e6 (patch)
treeaadeabd40c2ff69cc5e7acd14da149578c6d1732 /libs/gui/SurfaceComposerClient.cpp
parenta49b7b35cbf05725ff33badc8794d12fbc8a3190 (diff)
Store last data received from WindowInfosListener
Store the last data received from WindowInfoListener on the client so it can easily be retrieved when a new caller registers to listen for updates. This will help with accessibility since they won't need to register their listener all the time and instead just get the last data that was sent, immediately. From the system server process, the data is constantly being updated because WindowInfo is sent to InputDispatcher when any geometry in SF changes. If a different process registers for the WindowInfoListener, it's possible the initial data will be empty since we won't explicitly request the latest data immediately. Test: Accessibility register only when enabled Bug: 222767081 Change-Id: If13b8f44bc2fc38796df009d389b984408da55b3
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 27856cef13..efa73df700 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -2320,9 +2320,11 @@ int SurfaceComposerClient::getGPUContextPriority() {
}
status_t SurfaceComposerClient::addWindowInfosListener(
- const sp<WindowInfosListener>& windowInfosListener) {
+ const sp<WindowInfosListener>& windowInfosListener,
+ std::pair<std::vector<gui::WindowInfo>, std::vector<gui::DisplayInfo>>* outInitialInfo) {
return WindowInfosListenerReporter::getInstance()
- ->addWindowInfosListener(windowInfosListener, ComposerService::getComposerService());
+ ->addWindowInfosListener(windowInfosListener, ComposerService::getComposerService(),
+ outInitialInfo);
}
status_t SurfaceComposerClient::removeWindowInfosListener(