summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Chavi Weingarten <chaviw@google.com> 2024-01-23 21:18:03 +0000
committer Chavi Weingarten <chaviw@google.com> 2024-01-23 21:22:39 +0000
commit1a0843083d816dd8ef9a1028ca0194902befb4b0 (patch)
tree72a2c2a7aba3235ced51f5fdc8c610bf3ff5c4c3 /libs/androidfw/StringPool.cpp
parentb431dc66d417d306d6a8d8fae40d54147b921e67 (diff)
Use sync screen capture when needed
The ideal way to request screenshots is via the async oneway call into SurfaceFlinger. However, a lot of the legacy code requires the buffer to be available before proceeding. This means we still need to handle sync screenshots even when there's performance overhead. This is needed because there are places in system server that request screenshots while holding a lock and then wait synchronously on the results. While waiting on the buffer and holding the lock, additional two way binder calls can be made into system server that are waiting to acquire the same lock. If there are enough requests, we may run out of binder threads and then the screen capture result can't be posted back to system server because it needs a free binder thread. This will result in a deadlock because the lock that the screenshot request is holding can never be unlocked without a free binder thread. Binder threads will never be freed up because they are waiting to acquire the lock. The async screencapture code is still useful for cases where there's no global lock being held while waiting on results or the results is posted. Removed simple places where the global lock is held when making screenshot requests Bug: 321263247 Test: Screenshots Change-Id: I027cec03bf83db10da29c4ef1195a9e4c8867df8
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions