summaryrefslogtreecommitdiff
path: root/libs/androidfw/AssetsProvider.cpp
diff options
context:
space:
mode:
author Miranda Kephart <mkephart@google.com> 2024-09-23 11:21:26 -0400
committer Miranda Kephart <mkephart@google.com> 2024-10-01 09:41:40 -0400
commita65450bf20a0da794ac8d17d23e3c7aa83a978bc (patch)
tree52b1b3326698ae1b85af560f8d81b829c3584f34 /libs/androidfw/AssetsProvider.cpp
parent20f915ecfc8d529eb01bc66831dfc38c38f23698 (diff)
Handle ScreenshotHelper references correctly
The screenshot service is a singleton, but there may be multiple instances of ScreenshotHelper, each with their own 'finish' callbacks that tell them to reset their connection to the screenshot service. For example, in general each invocation method has its own instance of ScreenshotHelper. However, when we get a new invocation while the ScreenshotController is running, we just update our pointer to the new callback, losing the reference to the old callback. This means that if screenshots are invoked with two different instances of ScreenshotHelper simultaneously (e.g. by invoking via quick tap and then by keychord while the UI is still up) we will never call finish() on the first instance and it will keep holding on to its connection to the screenshot service (so the screenshot service will never be unbound). This change keeps track of all the currently held callbacks and calls them when the screenshot controller finishes. Bug: 334551134 Fix: 334551134 Test: take two screenshots in succession using different invocation methods; verify that the screenshot process is unbound and destroyed Flag: EXEMPT minor change Change-Id: I1df15abf82b5b1348485148956cd2f386aed5bdb
Diffstat (limited to 'libs/androidfw/AssetsProvider.cpp')
0 files changed, 0 insertions, 0 deletions