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

Commit 6e830364 authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Switch to "quiet" screenshot success when window destroyed

Currently, if the screenshot UI is dismissed before the screenshot
finishes saving, we'll get a spurious "SCREENSHOT_INTERACTION_TIMEOUT"
log. This is because the screenshot saving triggers
"showUiOnActionsReady", which updates the UI and resets the timeout.
Updating the UI is a no-op in this situation since the window/view
are no longer attached, but the timeout is reset, causing a
timeout log six seconds later.

It doesn't make any sense to try to show UI after dismissal, so we
should just do the same thing we do for the "old" screenshot during
successive screenshots and save silently.

Bug: 262242456
Fix: 262242456
Test: make statsd_testdrive && $ANDROID_HOST_OUT/bin/statsd_testdrive 90
Change-Id: I0de70d839502c7799da8a8b31e69cfbca0955bd4
parent ba0a4d16
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -448,6 +448,10 @@ public class ScreenshotController {

    // Any cleanup needed when the service is being destroyed.
    void onDestroy() {
        if (mSaveInBgTask != null) {
            // just log success/failure for the pre-existing screenshot
            mSaveInBgTask.setActionsReadyListener(this::logSuccessOnActionsReady);
        }
        removeWindow();
        releaseMediaPlayer();
        releaseContext();