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
Loading
Please register or sign in to comment