OSDN Git Service

Fixing crash when focusing tasks.
authorWinson <winsonc@google.com>
Wed, 24 Feb 2016 20:05:26 +0000 (12:05 -0800)
committerWinson <winsonc@google.com>
Thu, 25 Feb 2016 00:31:10 +0000 (16:31 -0800)
commitc438702740cd2893fe3bcec5546049e6b6172eb4
tree768eb6bad6fa6c1297c6d28fbeabad4380855282
parent12858a6eaea8ae85e7244bd904e1e31291ceea3c
Fixing crash when focusing tasks.

- We call bindVisibleTaskViews() at the new scroll value expecting all
  visible task views at that scroll to be bound synchronously, however,
  the call to computeVisibleTaskTransforms() would not produce the
  correct visible range if the visible range at the current and new
  scroll resulted in gaps (ie. at scroll 0, 0-3 are visible, and at
  scroll s, 5-8 were visible).  As a result, the task view would not be
  bound, causing a later crash.

  Instead of the optimization before, which would assume every task
  after the first non-visible task would also be non-visible, we can
  just update the transforms for all task views.  This ensures that
  all visible task views should be bound, even if they are not in a
  contiguous range.  A global range is still provided in the call to
  allow accessibility to focus the next task when a task is unbound at
  the two ends of the stack.
- Also removing expensive calls to remove all listeners and cancel
  animations that are not even started.

Bug: 27295423

Change-Id: Ib309e9de3095cacb178ae9ff5c53b8ee2c7ddac0
packages/SystemUI/src/com/android/systemui/recents/misc/Utilities.java
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java