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

Commit 42c6529c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SurfaceView: Don't destroy Surface while Stopped." into oc-dev

parents da3d71f0 73678099
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -678,11 +678,18 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
                } finally {
                    mIsCreating = false;
                    if (mSurfaceControl != null && !mSurfaceCreated) {
                        mSurfaceControl.destroy();
                        mSurface.release();
                        // If we are not in the stopped state, then the destruction of the Surface
                        // represents a visual change we need to display, and we should go ahead
                        // and destroy the SurfaceControl. However if we are in the stopped state,
                        // we can just leave the Surface around so it can be a part of animations,
                        // and we let the life-time be tied to the parent surface.
                        if (!mWindowStopped) {
                            mSurfaceControl.destroy();
                            mSurfaceControl = null;
                        }
                    }
                }
            } catch (Exception ex) {
                Log.e(TAG, "Exception configuring surface", ex);
            }