Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a65450bf authored by Miranda Kephart's avatar Miranda Kephart
Browse files

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
parent 20f915ec
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment