OSDN Git Service

Cancel or drop key events if activity is stopped.
authorWale Ogunwale <ogunwale@google.com>
Wed, 5 Nov 2014 23:17:35 +0000 (15:17 -0800)
committerWale Ogunwale <ogunwale@google.com>
Wed, 12 Nov 2014 17:23:22 +0000 (09:23 -0800)
commitc3672cd3f7e2bd87d6de9dada499de82b62fae84
tree50790c0f298cc02eca8860be8208493ef1988843
parent89444a380d85f8961a4a900734590571375b4f3f
Cancel or drop key events if activity is stopped.

After an activity instance state is saved due to onStop()/onPause(),
there is a small window where it can still get key events like the
back button since we still allow the ActivityThread to handle
pending messages (like memory trim request) before informing the
activity manager that we are done. If the activity is stopped,
we will now drop non-terminal input events and set the cancel
flag on terminal events.

Bug: 18151331
Change-Id: I370d7c871530eea4b16fa42428d0248f1a87abb6
core/java/android/view/InputEvent.java
core/java/android/view/KeyEvent.java
core/java/android/view/MotionEvent.java
core/java/android/view/ViewRootImpl.java