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

Commit 64ea6ca2 authored by Tim Murray's avatar Tim Murray Committed by android-build-team Robot
Browse files

wm: recycle bitmaps immediately in TaskSnapshotPersister

Bitmap created in TaskSnapshotPersister are very short lived and
shouldn't be left around in the Java heap.

Test: boot, switch apps, works
bug 117795621

Merged-in: I4b5e0db50c2b7adaa71cb0d22535c1b37c7523e8
Change-Id: I4b5e0db50c2b7adaa71cb0d22535c1b37c7523e8
(cherry picked from commit 9b4eaf74)
parent 7d4945ca
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -360,6 +360,7 @@ class TaskSnapshotPersister {


            // For snapshots with reduced resolution, do not create or save full sized bitmaps
            // For snapshots with reduced resolution, do not create or save full sized bitmaps
            if (mSnapshot.isReducedResolution()) {
            if (mSnapshot.isReducedResolution()) {
                swBitmap.recycle();
                return true;
                return true;
            }
            }


@@ -372,6 +373,8 @@ class TaskSnapshotPersister {
                Slog.e(TAG, "Unable to open " + file + " for persisting.", e);
                Slog.e(TAG, "Unable to open " + file + " for persisting.", e);
                return false;
                return false;
            }
            }
            reduced.recycle();
            swBitmap.recycle();
            return true;
            return true;
        }
        }
    }
    }