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

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

Merge "Do not draw snapshot starting window if can't get a valid Canvas." into main

parents 8610fc92 e247d369
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -237,13 +237,14 @@ public class SnapshotDrawerUtils {
                        PixelFormat.RGBA_8888,
                        GraphicBuffer.USAGE_HW_TEXTURE | GraphicBuffer.USAGE_HW_COMPOSER
                                | GraphicBuffer.USAGE_SW_WRITE_RARELY);
                if (background == null) {
                final Canvas c = background != null ? background.lockCanvas() : null;
                if (c == null) {
                    Log.e(TAG, "Unable to draw snapshot: failed to allocate graphic buffer for "
                            + mTitle);
                    mTransaction.clear();
                    childSurfaceControl.release();
                    return;
                }
                // TODO: Support this on HardwareBuffer
                final Canvas c = background.lockCanvas();
                drawBackgroundAndBars(c, frame);
                background.unlockCanvasAndPost(c);
                mTransaction.setBuffer(mRootSurface,