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

Commit 5df85473 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Recycle bitmap when persist snapshot finish" into main

parents 3b211a3a a6213633
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -348,6 +348,9 @@ class SnapshotPersistQueue {
                        + bitmap.isMutable() + ") to (config=ARGB_8888, isMutable=false) failed.");
                return false;
            }
            final int width = bitmap.getWidth();
            final int height = bitmap.getHeight();
            bitmap.recycle();

            final File file = mPersistInfoProvider.getHighResolutionBitmapFile(mId, mUserId);
            try {
@@ -365,8 +368,8 @@ class SnapshotPersistQueue {
            }

            final Bitmap lowResBitmap = Bitmap.createScaledBitmap(swBitmap,
                    (int) (bitmap.getWidth() * mPersistInfoProvider.lowResScaleFactor()),
                    (int) (bitmap.getHeight() * mPersistInfoProvider.lowResScaleFactor()),
                    (int) (width * mPersistInfoProvider.lowResScaleFactor()),
                    (int) (height * mPersistInfoProvider.lowResScaleFactor()),
                    true /* filter */);
            swBitmap.recycle();