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

Commit ab359beb authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Fix crash when taking screenshots from overview

When taking screenshots from overview, the current screenshot
wasn't being cleared, leading to a crash when we tried to add the
view to the window again. Clearing the screenshot first (as we do
when taking screenshots from hardware/global actions) fixes the
problem.

Fixes: 151153057
Test: manual (verified that error occurs if you tap the screenshot
button while the UI is up pre-fix, and crash does not happen
post-fix)

Change-Id: Ia33344ce19c912241e18d3053ccdc51845603ca3
parent 86a72111
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -347,6 +347,7 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
    void handleImageAsScreenshot(Bitmap screenshot, Rect screenshotScreenBounds,
    void handleImageAsScreenshot(Bitmap screenshot, Rect screenshotScreenBounds,
            Insets visibleInsets, int taskId, Consumer<Uri> finisher) {
            Insets visibleInsets, int taskId, Consumer<Uri> finisher) {
        // TODO use taskId and visibleInsets
        // TODO use taskId and visibleInsets
        clearScreenshot("new screenshot requested");
        takeScreenshot(screenshot, finisher, screenshotScreenBounds);
        takeScreenshot(screenshot, finisher, screenshotScreenBounds);
    }
    }