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

Commit 7182ca55 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Check for null parent when migrating SurfaceControl" into rvc-dev am: 9fa6e684

Change-Id: Id098120a2bbe3752796cb1e46a6a3010c223b009
parents 9772d394 9fa6e684
Loading
Loading
Loading
Loading
+15 −2
Original line number Original line Diff line number Diff line
@@ -399,7 +399,11 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
    }
    }


    void createSurfaceControl(boolean force) {
    void createSurfaceControl(boolean force) {
        setSurfaceControl(makeSurface().build());
        setInitialSurfaceControlProperties(makeSurface().build());
    }

    private void setInitialSurfaceControlProperties(SurfaceControl surfaceControl) {
        setSurfaceControl(surfaceControl);
        getPendingTransaction().show(mSurfaceControl);
        getPendingTransaction().show(mSurfaceControl);
        onSurfaceShown(getPendingTransaction());
        onSurfaceShown(getPendingTransaction());
        updateSurfacePosition();
        updateSurfacePosition();
@@ -423,7 +427,16 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        // Clear the last position so the new SurfaceControl will get correct position
        // Clear the last position so the new SurfaceControl will get correct position
        mLastSurfacePosition.set(0, 0);
        mLastSurfacePosition.set(0, 0);


        createSurfaceControl(false /* force */);
        final SurfaceControl.Builder b = mWmService.makeSurfaceBuilder(null)
                .setContainerLayer()
                .setName(getName());

        setInitialSurfaceControlProperties(b.build());

        // If parent is null, the layer should be placed offscreen so reparent to null. Otherwise,
        // set to the available parent.
        t.reparent(mSurfaceControl, mParent == null ? null : mParent.getSurfaceControl());

        if (mLastRelativeToLayer != null) {
        if (mLastRelativeToLayer != null) {
            t.setRelativeLayer(mSurfaceControl, mLastRelativeToLayer, mLastLayer);
            t.setRelativeLayer(mSurfaceControl, mLastRelativeToLayer, mLastLayer);
        } else {
        } else {