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

Commit 88f29242 authored by Matt Casey's avatar Matt Casey
Browse files

Don't try to load a long screenshot image more than once

If the preview already has a drawable onStart, there's nothing else to do.

Previously we'd always try to load an image onStart which would break if
onStart wasn't caused by either an initial load or a state restoration.

Bug: 193045988
Test: When cropping long screenshot, swipe up to overview, then return.
      Previously, the activity would disappear, now it continues undisturbed.

Change-Id: Ief1f10ce621e7f25bf3acbcf04ad3b6c04a28577
parent 214d1295
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -164,6 +164,11 @@ public class LongScreenshotActivity extends Activity {
        Log.d(TAG, "onStart");
        super.onStart();

        if (mPreview.getDrawable() != null) {
            // We already have an image, so no need to try to load again.
            return;
        }

        if (mCacheLoadFuture != null) {
            Log.d(TAG, "mCacheLoadFuture != null");
            final ListenableFuture<ImageLoader.Result> future = mCacheLoadFuture;