diff options
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; |