OSDN Git Service

Fix crash when trying to use uninitialized layout.
authorWinson <winsonc@google.com>
Fri, 8 Jan 2016 00:59:53 +0000 (16:59 -0800)
committerWinson Chung <winsonc@google.com>
Fri, 8 Jan 2016 01:03:35 +0000 (01:03 +0000)
Bug: 26453007
Change-Id: I006cf2f622b267163230eae4a07ef676c805f5c3

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

index 1ee22e9..726e453 100644 (file)
@@ -751,6 +751,11 @@ public class TaskStackLayoutAlgorithm {
      * Updates the current transforms that would put a TaskView at the front and back of the stack.
      */
     private void updateFrontBackTransforms() {
+        // Return early if we have not yet initialized
+        if (mStackRect.isEmpty()) {
+            return;
+        }
+
         float min = mUnfocusedRange.relativeMin +
                 mFocusState * (mFocusedRange.relativeMin - mUnfocusedRange.relativeMin);
         float max = mUnfocusedRange.relativeMax +