OSDN Git Service

Adding workaround for the status bar not reporting the correct system decor rect.
authorWinson Chung <winsonc@google.com>
Fri, 21 Mar 2014 01:04:46 +0000 (18:04 -0700)
committerWinson Chung <winsonc@google.com>
Fri, 21 Mar 2014 01:04:46 +0000 (18:04 -0700)
Change-Id: I2ea089e9d41deb2ac2a266694ac65d58830856f5

services/core/java/com/android/server/wm/WindowStateAnimator.java

index 32f0a27..5df4ce8 100644 (file)
@@ -1165,7 +1165,10 @@ class WindowStateAnimator {
         if (mHasClipRect) {
 
             // If we have an animated clip rect, intersect it with the system decor rect
-            int offsetTop = w.mSystemDecorRect.top;
+            // NOTE: We are adding a temporary workaround due to the status bar not always reporting
+            // the correct system decor rect.  In such cases, we take into account the specified
+            // content insets as well.
+            int offsetTop = Math.max(w.mSystemDecorRect.top, w.mContentInsets.top);
             mTmpClipRect.set(w.mSystemDecorRect);
             mTmpClipRect.offset(0, -offsetTop);
             mTmpClipRect.intersect(mClipRect);