Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c78702d authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Maybe fix issue #7146119: exception in FragmentManager" into jb-mr1-dev

parents 39de2b0e 8d5e6f8d
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -3612,8 +3612,31 @@ public final class ViewRootImpl implements ViewParent,
                finishInputEvent(q, true);
            } else {
                if (q.mEvent instanceof KeyEvent) {
                    KeyEvent event = (KeyEvent)q.mEvent;
                    if (event.getAction() != KeyEvent.ACTION_UP) {
                        // If the window doesn't currently have input focus, then drop
                        // this event.  This could be an event that came back from the
                        // IME dispatch but the window has lost focus in the meantime.
                        if (!mAttachInfo.mHasWindowFocus) {
                            Slog.w(TAG, "Dropping event due to no window focus: " + event);
                            finishInputEvent(q, true);
                            return;
                        }
                    }
                    deliverKeyEventPostIme(q);
                } else {
                    MotionEvent event = (MotionEvent)q.mEvent;
                    if (event.getAction() != MotionEvent.ACTION_CANCEL
                            && event.getAction() != MotionEvent.ACTION_UP) {
                        // If the window doesn't currently have input focus, then drop
                        // this event.  This could be an event that came back from the
                        // IME dispatch but the window has lost focus in the meantime.
                        if (!mAttachInfo.mHasWindowFocus) {
                            Slog.w(TAG, "Dropping event due to no window focus: " + event);
                            finishInputEvent(q, true);
                            return;
                        }
                    }
                    final int source = q.mEvent.getSource();
                    if ((source & InputDevice.SOURCE_CLASS_TRACKBALL) != 0) {
                        deliverTrackballEventPostIme(q);