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

Commit 52dcebf7 authored by Todd Lee's avatar Todd Lee
Browse files

Extend null check on surface control when creating BLASTSurface

Bug: b/379967338
Change-Id: I9aa362b91c991b4476ea7e8c0db5630ae842109a
Flag: NONE exempt trivial
Test: treehugger
parent 2298a416
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -2409,6 +2409,12 @@ public abstract class WallpaperService extends Service {
                };

        private Surface getOrCreateBLASTSurface(int width, int height, int format) {
            if (mBbqSurfaceControl == null || !mBbqSurfaceControl.isValid()) {
                Log.w(TAG, "Skipping BlastBufferQueue update/create"
                    + " - invalid surface control");
                return null;
            }

            Surface ret = null;
            if (mBlastBufferQueue == null) {
                mBlastBufferQueue = new BLASTBufferQueue("Wallpaper", mBbqSurfaceControl,
@@ -2418,11 +2424,7 @@ public abstract class WallpaperService extends Service {
                // it hasn't changed and there is no need to update.
                ret = mBlastBufferQueue.createSurface();
            } else {
                if (mBbqSurfaceControl != null && mBbqSurfaceControl.isValid()) {
                mBlastBufferQueue.update(mBbqSurfaceControl, width, height, format);
                } else {
                    Log.w(TAG, "Skipping BlastBufferQueue update - invalid surface control");
                }
            }

            return ret;