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

Commit 4dc1ec75 authored by Doris Liu's avatar Doris Liu
Browse files

Fix crash when creating a HW Bitmap on a detached view

BUG: 65160121
Test: Unable to repro the crash before or after the fix

Change-Id: I84fa28557c67a6672b8d82443d4da7be4f28a50d
parent 73e6ff19
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -159,6 +159,9 @@ public class TransitionUtils {
     * @return A bitmap of the given view or null if bounds has no width or height.
     */
    public static Bitmap createViewBitmap(View view, Matrix matrix, RectF bounds) {
        if (!view.isAttachedToWindow()) {
            return null;
        }
        Bitmap bitmap = null;
        int bitmapWidth = Math.round(bounds.width());
        int bitmapHeight = Math.round(bounds.height());