From 9848c84d026186aa9a186d4587b615aae06a2ef6 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Tue, 26 Apr 2016 20:44:30 -0700 Subject: [PATCH] Fix surfaceInset adjustment. surfaceInsets are relative and have the same sign direction for left/top/right/bottom. This means we want to subtract the left/top insets and add the right/bottom in order to expand the surface. The current code is adding the left/right insets before adding them to the right, while still subtracting from the left. This ends up expanding the surface by 3*inset pixels instead of 2*inset pixels. Bug: 28368990 Change-Id: I6495e39283c7d2494c962f89e95672c5f1f6e1cd --- .../core/java/com/android/server/wm/WindowStateAnimator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 1493bc73a17f8..fce3130ce9956 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -820,8 +820,8 @@ class WindowStateAnimator { // Adjust for surface insets. mTmpSize.left -= scale * attrs.surfaceInsets.left; mTmpSize.top -= scale * attrs.surfaceInsets.top; - mTmpSize.right += scale * (attrs.surfaceInsets.left + attrs.surfaceInsets.right); - mTmpSize.bottom += scale * (attrs.surfaceInsets.top + attrs.surfaceInsets.bottom); + mTmpSize.right += scale * attrs.surfaceInsets.right; + mTmpSize.bottom += scale * attrs.surfaceInsets.bottom; } boolean hasSurface() {