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

Commit 74411669 authored by Lucas Dupin's avatar Lucas Dupin Committed by android-build-merger
Browse files

Merge "Fix for SurfaceView out of a view hierarchy" into oc-dev am: 9cd92959

am: 9169df47

Change-Id: I52ee3b55f0e6e7735738ec1ac07dd0e44d04124d
parents 35f1fe18 9169df47
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -295,7 +295,15 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb

    @Override
    protected void onDetachedFromWindow() {
        getViewRootImpl().removeWindowStoppedCallback(this);
        ViewRootImpl viewRoot = getViewRootImpl();
        // It's possible to create a SurfaceView using the default constructor and never
        // attach it to a view hierarchy, this is a common use case when dealing with
        // OpenGL. A developer will probably create a new GLSurfaceView, and let it manage
        // the lifecycle. Instead of attaching it to a view, he/she can just pass
        // the SurfaceHolder forward, most live wallpapers do it.
        if (viewRoot != null) {
            viewRoot.removeWindowStoppedCallback(this);
        }

        mAttachedToWindow = false;
        if (mGlobalListenersAdded) {