/**
 * Child container layer of {@code mSurface} with the same bounds as its parent, and cropped to
 * the surface insets. This surface is created only if a client requests it via {@link
 * #getBoundsLayer()}. By parenting to this bounds surface, child surfaces can ensure they do
 * not draw into the surface inset region set by the parent window.
 */
private SurfaceControl mBoundsLayer;

public SurfaceControl getBoundsLayer() {
    if (mBoundsLayer == null) {
        mBoundsLayer = new SurfaceControl.Builder(mSurfaceSession)
                .setContainerLayer()
                .setName("Bounds for - " + getTitle().toString())
                .setParent(getRenderSurfaceControl())
                .setCallsite("ViewRootImpl.getBoundsLayer")
                .build();
        setBoundsLayerCrop();
        mTransaction.show(mBoundsLayer).apply();
    }
   return mBoundsLayer;
}