diff options
author | Dianne Hackborn <hackbod@google.com> | 2013-10-13 15:20:09 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2013-10-13 15:56:29 -0700 |
commit | 021d243d6d113b114d5e71931e728f2aacb9ca14 (patch) | |
tree | b56b22913ebd040e22d1e9b231528e0e3ef15f24 /core/java/android | |
parent | 7fa498bf9bec98a4462c15eb10d5fd0e3c01d3bd (diff) | |
download | frameworks_base-021d243d6d113b114d5e71931e728f2aacb9ca14.zip frameworks_base-021d243d6d113b114d5e71931e728f2aacb9ca14.tar.gz frameworks_base-021d243d6d113b114d5e71931e728f2aacb9ca14.tar.bz2 |
Fix issue #11199654: Action bar enter animation skips frames when cleared by the system
We have become too aggressive about not allowing windows to draw while windw
animations are running, basically not allowing any drawing in any window when
there is any window animation. So if you did a relayout while the status bars
were being animated, your window would stop drawing until that status bar
animation was complete.
This change relaxes those rules in two ways:
- A particular window will only be told to stop updating when *it* is
currently involved in a window animation. So animations in status bars
will not stop app windows from update, and vice versa.
- If a window receives input events while it is in the "do not update"
state, we will immediately terminate that state and start allowing it to
draw. If the user is actually interacting with a window, we don't want
to wait to show feedback.
Change-Id: I72574eec048aee53115b46a78686cf27f42c42f7
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/view/ViewRootImpl.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index beb7366..c86bc45 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1408,9 +1408,9 @@ public final class ViewRootImpl implements ViewParent, final int surfaceGenerationId = mSurface.getGenerationId(); relayoutResult = relayoutWindow(params, viewVisibility, insetsPending); - if (!mDrawDuringWindowsAnimating) { - mWindowsAnimating |= - (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_ANIMATING) != 0; + if (!mDrawDuringWindowsAnimating && + (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_ANIMATING) != 0) { + mWindowsAnimating = true; } if (DEBUG_LAYOUT) Log.v(TAG, "relayout: frame=" + frame.toShortString() @@ -3798,6 +3798,9 @@ public final class ViewRootImpl implements ViewParent, if (q.mEvent instanceof KeyEvent) { return processKeyEvent(q); } else { + // If delivering a new non-key event, make sure the window is + // now allowed to start updating. + handleDispatchDoneAnimating(); final int source = q.mEvent.getSource(); if ((source & InputDevice.SOURCE_CLASS_POINTER) != 0) { return processPointerEvent(q); @@ -3812,6 +3815,12 @@ public final class ViewRootImpl implements ViewParent, private int processKeyEvent(QueuedInputEvent q) { final KeyEvent event = (KeyEvent)q.mEvent; + if (event.getAction() != KeyEvent.ACTION_UP) { + // If delivering a new key event, make sure the window is + // now allowed to start updating. + handleDispatchDoneAnimating(); + } + // Deliver the key to the view hierarchy. if (mView.dispatchKeyEvent(event)) { return FINISH_HANDLED; |