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

Commit 93068d7a authored by John Reck's avatar John Reck Committed by Android (Google) Code Review
Browse files

Merge "Handle window surface insets"

parents 0f8e6bd5 9bdd2e61
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -263,8 +263,16 @@ public final class PixelCopy {
                    "Only able to copy windows with decor views");
        }
        Surface surface = null;
        if (source.peekDecorView().getViewRootImpl() != null) {
            surface = source.peekDecorView().getViewRootImpl().mSurface;
        final ViewRootImpl root = source.peekDecorView().getViewRootImpl();
        if (root != null) {
            surface = root.mSurface;
            final Rect surfaceInsets = root.mWindowAttributes.surfaceInsets;
            if (srcRect == null) {
                srcRect = new Rect(surfaceInsets.left, surfaceInsets.top,
                        root.mWidth + surfaceInsets.left, root.mHeight + surfaceInsets.top);
            } else {
                srcRect.offset(surfaceInsets.left, surfaceInsets.top);
            }
        }
        if (surface == null || !surface.isValid()) {
            throw new IllegalArgumentException(