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

Commit 77b32335 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Extend null check on surface control when creating BLASTSurface" into main

parents d5ea09ee 52dcebf7
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;