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

Commit 453fc364 authored by Bryce Lee's avatar Bryce Lee
Browse files

Limit creating new surface for legacy apps to size changes.

Creating the surface for every change (such as creation and
visibility) can lead to issues swapping buffers. This
changelist limits the action to only when the size changes.

Change-Id: Ic549d244613a93a43a9f4ddf284bbfb0c13300fa
Fixes: 62801621
Test: follow repro steps in bug, verified no crash.
Test: go/wm-smoke
parent aed0c10d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -641,7 +641,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
                        mSurface.copyFrom(mSurfaceControl);
                        mSurface.copyFrom(mSurfaceControl);
                    }
                    }


                    if (getContext().getApplicationInfo().targetSdkVersion
                    if (sizeChanged && getContext().getApplicationInfo().targetSdkVersion
                            < Build.VERSION_CODES.O) {
                            < Build.VERSION_CODES.O) {
                        // Some legacy applications use the underlying native {@link Surface} object
                        // Some legacy applications use the underlying native {@link Surface} object
                        // as a key to whether anything has changed. In these cases, updates to the
                        // as a key to whether anything has changed. In these cases, updates to the