diff options
author | Justin Klaassen <justinklaassen@google.com> | 2018-04-03 23:21:57 -0400 |
---|---|---|
committer | Justin Klaassen <justinklaassen@google.com> | 2018-04-03 23:21:57 -0400 |
commit | 4d01eeaffaa720e4458a118baa137a11614f00f7 (patch) | |
tree | 66751893566986236788e3c796a7cc5e90d05f52 /android/view/PixelCopy.java | |
parent | a192cc2a132cb0ee8588e2df755563ec7008c179 (diff) | |
download | android-28-4d01eeaffaa720e4458a118baa137a11614f00f7.tar.gz |
Import Android SDK Platform P [4697573]
/google/data/ro/projects/android/fetch_artifact \
--bid 4697573 \
--target sdk_phone_armv7-win_sdk \
sdk-repo-linux-sources-4697573.zip
AndroidVersion.ApiLevel has been modified to appear as 28
Change-Id: If80578c3c657366cc9cf75f8db13d46e2dd4e077
Diffstat (limited to 'android/view/PixelCopy.java')
-rw-r--r-- | android/view/PixelCopy.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/android/view/PixelCopy.java b/android/view/PixelCopy.java index a14609f3..2797a4da 100644 --- a/android/view/PixelCopy.java +++ b/android/view/PixelCopy.java @@ -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( |