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

Commit c6036ba8 authored by Robert Carr's avatar Robert Carr Committed by Rob Carr
Browse files

WallpaperService: Respond to WM protocol change.

The client is now responsible for updating the size of its own Surface.
When we updated ViewRootImpl we forgot to make this change for wallpaper
service.

Bug: 172346563
Test: Existing tests pass.
Change-Id: I2107106c8057151f3fa0d9761ce88abeefc58350
parent 8b819c0a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -199,6 +199,7 @@ public abstract class WallpaperService extends Service {
        final InsetsSourceControl[] mTempControls = new InsetsSourceControl[0];
        final MergedConfiguration mMergedConfiguration = new MergedConfiguration();
        private final Point mSurfaceSize = new Point();
        private final Point mLastSurfaceSize = new Point();
        private final Matrix mTmpMatrix = new Matrix();
        private final float[] mTmpValues = new float[9];

@@ -908,6 +909,14 @@ public abstract class WallpaperService extends Service {
                    if (mSurfaceControl.isValid()) {
                        mSurfaceHolder.mSurface.copyFrom(mSurfaceControl);
                    }
                    if (!mLastSurfaceSize.equals(mSurfaceSize)) {
                        mLastSurfaceSize.set(mSurfaceSize.x, mSurfaceSize.y);
                        if (mSurfaceControl != null && mSurfaceControl.isValid()) {
                            SurfaceControl.Transaction t = new SurfaceControl.Transaction();
                            t.setBufferSize(mSurfaceControl, mSurfaceSize.x, mSurfaceSize.y);
                            t.apply();
                        }
                    }

                    if (DEBUG) Log.v(TAG, "New surface: " + mSurfaceHolder.mSurface
                            + ", frame=" + mWinFrames);