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

Commit 62caf24a authored by Gaurav Bhola's avatar Gaurav Bhola Committed by Android (Google) Code Review
Browse files

Merge "Add getParentingSurfaceControl() in DisplayContent" into main

parents 0dd9b39a 14cc7776
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -1319,7 +1319,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        for (int i = 0; i < mChildren.size(); i++)  {
            SurfaceControl sc = mChildren.get(i).getSurfaceControl();
            if (sc != null) {
                t.reparent(sc, mSurfaceControl);
                t.reparent(sc, getParentingSurfaceControl());
            }
        }

@@ -5828,6 +5828,21 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                || supportsSystemDecorations();
    }

    /**
     * Returns the {@link SurfaceControl} where all the children should be parented on.
     *
     * <p> {@link DisplayContent} inserts a RootWrapper leash in the hierarchy above its original
     * {@link #mSurfaceControl} and then overrides the {@link #mSurfaceControl} to point to the
     * RootWrapper.
     * <p> To prevent inconsistent state later where the DAs might get re-parented to the
     * RootWrapper, this method should be used which returns the correct surface where the
     * re-parenting should happen.
     */
    @Override
    SurfaceControl getParentingSurfaceControl() {
        return mWindowingLayer;
    }

    SurfaceControl getWindowingLayer() {
        return mWindowingLayer;
    }
+12 −1
Original line number Diff line number Diff line
@@ -716,7 +716,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<

        // 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());
        t.reparent(mSurfaceControl, mParent == null ? null : mParent.getParentingSurfaceControl());

        if (mLastRelativeToLayer != null) {
            t.setRelativeLayer(mSurfaceControl, mLastRelativeToLayer, mLastLayer);
@@ -2906,6 +2906,17 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        return mSurfaceControl;
    }

    /**
     * Returns the {@link SurfaceControl} where all the children should be parented on.
     *
     * A {@link WindowContainer} might insert intermediate leashes in the hierarchy and hence
     * {@link #getSurfaceControl} won't return the correct surface where the children should be
     * re-parented on.
     */
    SurfaceControl getParentingSurfaceControl() {
        return getSurfaceControl();
    }

    /**
     * Use this method instead of {@link #getPendingTransaction()} if the Transaction should be
     * synchronized with the client.