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

Commit ca08003d authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Reduce unnecessary overhead of screenshot bitmap from assist"

parents a9933e3f afd99035
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -4814,16 +4814,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        final Bitmap bitmap = screenshotBuffer == null ? null : screenshotBuffer.asBitmap();
        if (bitmap == null) {
            Slog.w(TAG_WM, "Failed to take screenshot");
            return null;
        }

        // Create a copy of the screenshot that is immutable and backed in ashmem.
        // This greatly reduces the overhead of passing the bitmap between processes.
        final Bitmap ret = bitmap.asShared();
        if (ret != bitmap) {
            bitmap.recycle();
        }
        return ret;
        return bitmap;
    }

    @Override