OSDN Git Service

Always force update the transform when calling from RecentsImpl.
authorWinson <winsonc@google.com>
Fri, 1 Apr 2016 18:25:35 +0000 (11:25 -0700)
committerWinson Chung <winsonc@google.com>
Fri, 1 Apr 2016 18:28:23 +0000 (18:28 +0000)
- Workaround for crash in RecentsImpl where we could be retrieving the
  transform for a task that is not at the front of the stack (can happen
  if time changes, etc.)  However, since we only use the size for the
  transition, we can always force-update the transform.

Bug: 27849282
Change-Id: I86eee4c158748e4f13a2daeac5cf040c0874f967

packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java

index 43d627d..ec873ec 100644 (file)
@@ -794,6 +794,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
             synchronized (mHeaderBarLock) {
                 int toHeaderWidth = (int) toTransform.rect.width();
                 int toHeaderHeight = (int) (mHeaderBar.getMeasuredHeight() * toTransform.scale);
+                if (toHeaderWidth <= 0 || toHeaderHeight <= 0) {
+                    return null;
+                }
                 boolean disabledInSafeMode = !toTask.isSystemApp && ssp.isInSafeMode();
                 mHeaderBar.onTaskViewSizeChanged((int) toTransform.rect.width(),
                         (int) toTransform.rect.height());
index 2508304..1cddde7 100644 (file)
@@ -803,8 +803,9 @@ public class TaskStackLayoutAlgorithm {
     public TaskViewTransform getStackTransformScreenCoordinates(Task task, float stackScroll,
             TaskViewTransform transformOut, TaskViewTransform frontTransform) {
         Rect windowRect = Recents.getSystemServices().getWindowRect();
-        TaskViewTransform transform = getStackTransform(task, stackScroll, transformOut,
-                frontTransform);
+        TaskViewTransform transform = getStackTransform(task, stackScroll, mFocusState,
+                transformOut, frontTransform, true /* forceUpdate */,
+                false /* ignoreTaskOverrides */);
         transform.rect.offset(windowRect.left, windowRect.top);
         return transform;
     }