History log of /frameworks/base/core/java/android/view/MotionEvent.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ded133c446fa9d0d23e6bde19a66fb2ce3980491 31-Jan-2015 Svetoslav <svetoslavganov@google.com> Fix broken activation of the selected view in accessibility mode.

We were using an approximation to determine where to send a pair of down
and up events to click on the view that has accessibility focus. We were
doing reverse computation to figuring out which portion of the view is
not covered by interactive views and get a point in this region. However,
determining whether a view is interactive is not feasible in general since
for example may override onTouchEvent. This results in views not being
activated or which is worse wrong views being activated.

This change swithes to a new approach to activate views in accessibility
mode which is guaranteed to always work except the very rare case of a
view that overrides dispatchTouchEvent (which developers shouldn't be
doing). The new approach is to flag the down and up events pair sent
by the touch explorer as targeting the accessibility focused view. Such
events are dispatched such that views predecessors of the accessibility
focus do not handle them guaranteeing that these events reach the accessibiliy
focused view. Once the accessibiliy focused view gets such an event it clears
the flag and the event is dispatched following the normal event dispatch
semantics.

The new approach is semantically equivalent to requesting the view to perform
a click accessiblitiy action but is more generic as it is not affected by
views not implementing click action support correctly.

bug:18986806
bug:18889611

Change-Id: Id4b7b886c9fd34f7eb11e606636d8e3bab122869
/frameworks/base/core/java/android/view/MotionEvent.java
c3672cd3f7e2bd87d6de9dada499de82b62fae84 06-Nov-2014 Wale Ogunwale <ogunwale@google.com> 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
/frameworks/base/core/java/android/view/MotionEvent.java
cc32bd83e4d420c1adaeb3ea40f8986471e54590 20-May-2014 Sujith Ramakrishnan <sujithrk@google.com> Add support for mouse-based text selection.

Incorporate patch from Logitech (donated under AOSP license) to the
framework to add mouse-based text selection to ArrowKeyMovementMethod.

Bug: 14652753

Change-Id: Iab264bb954b72ccedfada763eba8f13ef37a4578
/frameworks/base/core/java/android/view/MotionEvent.java
973efa0813260c24390d46b07e524de605630180 14-May-2014 Michael Wright <michaelwr@google.com> Only translate prefixed strings to keys / axes.

In order to maintain compatibility, we need to only translate strings
prefixed with KEYCODE_ or AXIS_ into the appropriate key codes /
axes. Otherwise things like `adb shell input` will convert 4 into
KEYCODE_4 whereas before it would convert it into KEYCODE_BACK.

Bug: 14807833
Change-Id: I2cb41aa55dbb2e3fd62664c1b944877290d7e4be
/frameworks/base/core/java/android/view/MotionEvent.java
337d9d2edc262141f9b8f684e53aae5e47f0ae13 23-Apr-2014 Michael Wright <michaelwr@google.com> Move key attribute information into KeyEvent.

This consolidates all of the information that was in the native
KeyEvent and the KeyLayout files into the managed KeyEvent class.

It also moves the definition for all of the key names to the native
side, rather than having them in both places.

Change-Id: I172e3b554e7eb52c79ae2ec406ef4332e8b25ffa
/frameworks/base/core/java/android/view/MotionEvent.java
9adca065148f704187866c53cceda8e0050b1f35 19-Mar-2014 Michael Wright <michaelwr@google.com> Respect ACTION_CANCEL for joystick fallbacks

Also change MotionEvent.PointerCoords bit packing and unpacking
methods to be consistent with BitSets which are now used on the
native PointerCoords object.

Bug: 11480300
Change-Id: Ic6c7ebda5c545d07ea1ed259ca1f1184ccf85f29
/frameworks/base/core/java/android/view/MotionEvent.java
99a1ef2b7f1eb7266e1c3782f649de0d8dbe23bf 08-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Use long for pointers in MotionEvent class

For storing pointers, long is used in MotionEvent class,
as native pointers can be 64-bit.

Change-Id: I88ebfef26070b7f49c14945cad37aa3db209ec90
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
/frameworks/base/core/java/android/view/MotionEvent.java
4dad6cab641f95524d86d0fe9f9d46e323aeb41b 05-Jun-2013 John Spurlock <jspurlock@google.com> Unhide MotionEvent#actionToString.

Also clarify the input as unmasked, and fix a few other found doc
issues in related methods.

Change-Id: I1338a17dea0282b99229925dea8e48693e177eaa
/frameworks/base/core/java/android/view/MotionEvent.java
072137c80a9ce30a1c79cc416932a24bd2e4dccb 25-Apr-2013 Michael Wright <michaelwr@google.com> Fixed javadoc in input related classes

Change-Id: Ie415f812a0f473488d74119dab18296a488db6b9
/frameworks/base/core/java/android/view/MotionEvent.java
b11499d2db0ba9782363ec6bf714b583e8585212 21-Apr-2012 Jeff Brown <jeffbrown@google.com> Make InputEvent.getEventTime() public.

Also add new methods to access the event timestamp in
nanoseconds. Hidden for now but useful for prototyping.

Bug: 6374616
Change-Id: I7030734a908e8e31a17a356debc269db7c0f0783
/frameworks/base/core/java/android/view/MotionEvent.java
9d3bdbd6b8f9eda5f67212b06185cd59adcda6c8 21-Mar-2012 Jeff Brown <jeffbrown@google.com> New WebView input dispatcher.

Bug: 6317798

Stuff that's better:

1. We maintain two queues in a way that ensures that WebView and
WebKit both see consistent streams of events, even in cases
where WebKit times out. We send ACTION_CANCEL if necessary, etc.

2. All pointer events go through the same channel, including
hover and click ("touch up") events, to ensure correct ordering.

3. Given that the input events are in a separate queue, we can
force execution of all of these events whenever we like, making new
latency optimizations possible.

4. The entire history of each touch event is sent to the web
application to enable smoother interaction.

5. The web application may choose to intercept a touch event stream
at any time by issuing "prevent default". Previously, it could only
prevent default on the initial down event. The new behavior is more
standards compliant.

Change-Id: I42d2d045e7d44af7c54b29570f188b7400d91d4e
/frameworks/base/core/java/android/view/MotionEvent.java
9ea77fc821918ea562ff4907945b865e39e0201a 22-Mar-2012 Jeff Brown <jeffbrown@google.com> Avoid calling into JNI if not needed.

Short-circuit a few MotionEvent JNI calls in simple cases.

Change-Id: I6c97c06b5a5fd203a423dc88f428637b9dec71ae
/frameworks/base/core/java/android/view/MotionEvent.java
92cc2d8dc35f2bdd1bb95ab24787066371064899 02-Dec-2011 Jeff Brown <jeffbrown@google.com> Remove type tests when recycling input events.

Change-Id: I1c2d5980a763c457a0546bbf601e686c601a4c03
/frameworks/base/core/java/android/view/MotionEvent.java
32cbc3855c2a971aa5a801fd339fb6a37db91a1a 01-Dec-2011 Jeff Brown <jeffbrown@google.com> Refactor InputQueue as InputEventReceiver.

This change simplifies the code associated with receiving input
events from input channels and makes it more robust. It also
does a better job of ensuring that input events are properly
recycled (sometimes we dropped them on the floor).

This change also adds a sequence number to all events, which is
handy for determining whether we are looking at the same event or a
new one, particularly when events are recycled.

Change-Id: I4ebd88f73b5f77f3e150778cd550e7f91956aac2
/frameworks/base/core/java/android/view/MotionEvent.java
65fd251c3913fc921468a3dad190810db19eb9df 18-Aug-2011 Jeff Brown <jeffbrown@google.com> Input system bug fixes, particularly for stylus.
Bug: 5049148

Finished stylus support, including support for indirect stylus
and mouse tools.

Added TILT axis. When stylus tilt X/Y is available, it is transformed
into an orientation and tilt inclination which is a more convenient
representation and a simpler extension to the exiting API.

Touch devices now only report touch data using a single input
source. Previously touch devices in pointer mode would report
both absolute touch pad data and cooked pointer gestures.
Now we just pick one. The touch device switches modes as needed
when the focused application enables/disables pointer gestures.
This change greatly simplifies the code and reduces the load
on the input dispatcher.

Fixed an incorrect assumption that the value of ABS_(MT_)DISTANCE
would be zero whenever the stylus was in direct contact. It appears
that the correct way to determine whether the stylus is in direct
contact (rather than hovering) is by checking for a non-zero
reported pressure.

Added code to read the initial state of tool buttons and axis values
when the input devices are initialized or reset. This fixes
problems where the input mapper state might have the wrong initial
state.

Moved responsibility for cancelling pending inputs (keys down,
touches, etc.) to the InputDispatcher by sending it a device reset
notification. This frees the InputReader from having to synthesize
events during reset, which was cumbersome and somewhat brittle
to begin with.

Consolidated more of the common accumulator logic from
SingleTouchInputMapper and MultiTouchInputMapper into
TouchInputMapper.

Improved the PointerLocation output.

Change-Id: I595d3647f7fd7cb1e3eff8b3c76b85043b5fe2f0
/frameworks/base/core/java/android/view/MotionEvent.java
49754db5a304d995c1cc108ff6f19e4ba4265572 02-Jul-2011 Jeff Brown <jeffbrown@google.com> Handle stylus buttons and tool types.

Added TOOL_TYPE_ERASER.

Refactored the InputReader to share more code between the
various input mappers that handle button states and to
simplify the accumulator implementations by having each
one only handle a single type of input.

Removed the concept of direct/indirect tool types from the API.
If we add it back, it should be done in a manner that is orthogonal
to the tool type itself, perhaps as a flags field on the pointer.
The device source may well provide sufficient information anyhow.

Change-Id: I811c22d95e8304269b6ee4f6d11a6b04f3cfc1b2
/frameworks/base/core/java/android/view/MotionEvent.java
98933f3f6875a7327a44fca7271ae997e45d3779 07-Jul-2011 Huahui Wu <hwu@google.com> Revert "b/3302378 Passes touch pressures, size and timestamps to webkit."

This reverts commit 6e64e0c61720244894dbd1fd6b36394adc63b2de.
It introduced a null pointer crash for pinch-and-zoom.

Change-Id: I886057053b4cd2aded0f58618a806f7a67e58968
/frameworks/base/core/java/android/view/MotionEvent.java
6e64e0c61720244894dbd1fd6b36394adc63b2de 29-Jun-2011 Huahui Wu <hwu@google.com> b/3302378 Passes touch pressures, size and timestamps to webkit.

Related CL in WebKit:
https://android-git.corp.google.com/g/#change,118422

Change-Id: Ibf209131a6d9ca8186c461b0c5b6286e5f669d0d
/frameworks/base/core/java/android/view/MotionEvent.java
8134681b25dfff814ffeaad8ff70e84316c1869f 29-Jun-2011 Jeff Brown <jeffbrown@google.com> Improve input event consistency invariants.

Fixed some issues where inconsistent streams of events could
be generated by the dispatcher, particularly when switching from
hovering with one device to hovering with another.

Fixed a bug where the touch pad would fail to generate a new
HOVER_MOVE following a tap event. As a result, the hover event
stream would not resume until the user touched the touch pad
again.

Change-Id: I444dce84641fb12e56a0af84c931520771d6c493
/frameworks/base/core/java/android/view/MotionEvent.java
53ca3f13e70fda98aa9f39bb0c15afaf435e3904 28-Jun-2011 Jeff Brown <jeffbrown@google.com> Hover and stylus API cleanup.

Added missing setOnHoverListener method.
Removed BUTTON_STATE_ERASER.

Change-Id: I5d820d0a8e47fe5fd2d88e9fd9fc3fc6ce0dea0d
/frameworks/base/core/java/android/view/MotionEvent.java
80fd47ce75253dcdc2cfa85d7a3f42634b923a47 24-May-2011 Jeff Brown <jeffbrown@google.com> Input device protocol enhancements.

Added support for Linux multitouch protocol B (slots).

Added support for using the device's input properties as a hint
to determine the intended usage of a touch device.

Added support for the ABS_MT_DISTANCE axis.

Fixed a bug reporting the presence of the orientation axis.

Change-Id: Icf7b5a5a0f1a9cdf6ad2b35be8ea0c1a35815d48
/frameworks/base/core/java/android/view/MotionEvent.java
fe9f8ab03a63b1037f07dd85799fbea80ec6adaa 07-May-2011 Jeff Brown <jeffbrown@google.com> Add initial API for stylus and mouse buttons.

Added the concept of pointer properties in a MotionEvent.
This is currently used to track the pointer tool type to enable
applications to distinguish finger touches from a stylus.

Button states are also reported to application as part of touch events.

There are no new actions for detecting changes in button states.
The application should instead query the button state from the
MotionEvent and take appropriate action as needed.

A good time to check the button state is on ACTION_DOWN.

As a side-effect, applications that do not support multiple buttons
will treat primary, secondary and tertiary buttons identically
for all touch events.

The back button on the mouse is mapped to KEYCODE_BACK
and the forward button is mapped to KEYCODE_FORWARD.

Added basic plumbing for the secondary mouse button to invoke
the context menu, particularly in lists.

Added clamp and split methods on MotionEvent to take care of
common filtering operations so we don't have them scattered
in multiple places across the framework.

Bug: 4260011
Change-Id: Ie992b4d4e00c8f2e76b961da0a902145b27f6d83
/frameworks/base/core/java/android/view/MotionEvent.java
21bc5c917d4ee2a9b2b8173091e6bba85eaff899 01-Mar-2011 Jeff Brown <jeffbrown@google.com> Add a little input event consistency verifier.

The idea is to assist with debugging by identifying cases in which
the input event stream is corrupted.

Change-Id: I0a00e52bbe2716be1b3dfc7c02a754492d8e7f1f
/frameworks/base/core/java/android/view/MotionEvent.java
a032cc008618b83ecbbede537517d1e7998e3264 08-Mar-2011 Jeff Brown <jeffbrown@google.com> Add MotionEvent.HOVER_ENTER and HOVER_EXIT.

The input dispatcher sends a HOVER_ENTER to a window before dispatching
it any HOVER_MOVE events. For compatibility reasons, the window will
*also* receive the HOVER_MOVE. When the pointer moves into a different
window or the pointer goes down or when events are canceled for some reason,
the input dispatcher sends a HOVER_EXIT to the previously hovered window.

The view hierarchy behavior is similar. All views under the pointer
receive onHoverEvent with HOVER_ENTER followed by any number of HOVER_MOVE
events. When the pointer leaves a view, the view receives HOVER_EXIT.
Similarly, if a parent view decides to capture hover by returning true
from onHoverEvent, the hovered descendants will receive HOVER_EXIT.

The default behavior of onHoverEvent is to update the view's hovered
state by calling setHovered(true/false). Views can query their current
hovered state using isHovered().

For testing purposes, the hovered state is mapped to the pressed
drawable state. This will change in a subsequent commit with the
introduction of a new hovered drawable state.

Change-Id: Ib76a7a90236c8f2c7336e55773acade6346cacbe
/frameworks/base/core/java/android/view/MotionEvent.java
3a22fa057091cd6614f58ebc57a7ce4fe29462bb 04-Mar-2011 Jeff Brown <jeffbrown@google.com> Joystick tweaks.

Ensure that the joystick can always reach -1.0, 0.0 and 1.0 positions
even when noise filtering is applied. (Bug: 3514510)

Add support for a few more standard axes.

Add additional mapping modes for axes.
Some axes are inverted from standard interpretation
or are actually intended to be split into two distict axes
such as left/right trigger controls or accelerator/brake.

Add key layout file for a G25 racing wheel and XBox 360 controller
to tweak behavior. They work fine without them but the axis mappings
are not ideal.

Change-Id: Id4c86a0a272331c680039a9bde6815bb7eba44ab
/frameworks/base/core/java/android/view/MotionEvent.java
d41cff2d3a95963a7aa348e502c6d42bae367235 03-Mar-2011 Jeff Brown <jeffbrown@google.com> Fix off by one errors in touch motion ranges.

Report inclusive minimum and maximum ranges for all
axes including X and Y.

Set mouse pointer bounds to 0..width-1, 0..height-1.

Rotate touch and mouse positions more carefully, paying attention
to the maximum bounds when calculating the complement of an axis.

Simplified the InputReader somewhat and removed support for a
couple of poorly defined input device configuration parameters.
We now assume that the touch device provides useful absolute axis
ranges for the X and Y axes since the alternative does not actually
make sense.

Bug: 3413541
Change-Id: I682ce3729e4473de7f1bcf8addb49a3f4484126f
/frameworks/base/core/java/android/view/MotionEvent.java
56194ebec6212e229f4ccdaa4b187166d20013ef 03-Mar-2011 Jeff Brown <jeffbrown@google.com> Wake screen from external HID peripherals.

Added some plumbing to enable the policy to intercept motion
events when the screen is off to handle wakeup if needed.

Added a basic concept of an external device to limit the scope
of the wakeup policy to external devices only. The wakeup policy
for internal devices should be based on explicit rules such as
policy flags in key layout files.

Moved isTouchEvent to native.

Ensure the dispatcher sends the right event type to userActivity
for non-touch pointer events like HOVER_MOVE and SCROLL.

Bug: 3193114
Change-Id: I15dbd48a16810dfaf226ff7ad117d46908ca4f86
/frameworks/base/core/java/android/view/MotionEvent.java
33bbfd2232ea9eaae9a9d87a05a95a430f09bd83 25-Feb-2011 Jeff Brown <jeffbrown@google.com> Add support for mouse hover and scroll wheel.

Dispatch ACTION_HOVER_MOVE and ACTION_SCROLL through the View
hierarchy as onGenericTouchEvent. Pointer events dispatched
this way are delivered to the view under the pointer. Non-pointer
events continue to be delivered to the focused view.

Added scroll wheel support to AbsListView, ScrollView,
HorizontalScrollView and WebView. Shift+VSCROLL is translated
to HSCROLL as appropriate.

Added logging of new pointer events in PointerLocationView.

Fixed a problem in EventHub when a USB device is removed that
resulted in a long stream of ENODEV errors being logged until INotify
noticed the device was gone.

Note that the new events are not supported by wallpapers at this time
because the wallpaper engine only delivers touch events.

Make all mouse buttons behave identically. (Effectively we only
support one button.)

Change-Id: I9ab445ffb63c813fcb07db6693987b02475f3756
/frameworks/base/core/java/android/view/MotionEvent.java
cc0c159e9b3dd4e0f48da0ce3e33d2c68a651413 19-Feb-2011 Jeff Brown <jeffbrown@google.com> Add new hover move action and scroll wheel plumbing.

Added support for tracking the mouse position even when the mouse button
is not pressed. To avoid confusing existing applications, mouse movements
are reported using the new ACTION_HOVER_MOVE action when the mouse button
is not pressed.

Added some more plumbing for the scroll wheel axes. The values are
reported to Views but they are not yet handled by the framework.

Change-Id: I1706be850d25cf34e5adf880bbed5cc3265cf4b1
/frameworks/base/core/java/android/view/MotionEvent.java
6f2fba428ca5e77a26d991ad728e346cc47609ee 19-Feb-2011 Jeff Brown <jeffbrown@google.com> Add new axes for joysticks and mouse wheels.

Added API on InputDevice to query the set of axes available.
Added API on KeyEvent and MotionEvent to convert keycodes and axes
to symbolic name strings for diagnostic purposes.
Added API on KeyEvent to query if a given key code is a gamepad button.
Added a new "axis" element to key layout files to specify the
mapping between raw absolute axis values and motion axis ids.
Expanded the axis bitfield to 64bits to allow for future growth.
Modified the Makefile for keyboard prebuilts to run the keymap
validation tool during the build.
Added layouts for two game controllers.
Added default actions for game pad button keys.
Added more tests.
Fixed a bunch of bugs.

Change-Id: I73f9166c3b3c5bcf4970845b58088ad467525525
/frameworks/base/core/java/android/view/MotionEvent.java
91c69ab01539f7ba28708f41ec1835cc2920d0a0 15-Feb-2011 Jeff Brown <jeffbrown@google.com> Add support for arbitrary axes in MotionEvents.

This change makes it possible to extend the set of axes that
are reported in MotionEvents by defining new axis constants.

The MotionEvent object is now backed by its C++ counterpart
to avoid having to maintain multiple representations of the
same data.

Change-Id: Ibe93c90d4b390d43c176cce48d558d20869ee608
/frameworks/base/core/java/android/view/MotionEvent.java
61b9649a50aefacc74449728e96f37f6f9d7a8b3 24-Jan-2011 Huahui Wu <hwu@google.com> am 6e4a69bb: am 94b8b114: Merge "A few small cleanning-ups." into honeycomb

* commit '6e4a69bbf7d7566899ec76d2634538dd79ca4166':
A few small cleanning-ups.
f93246923f0a8c85fddb508533d63d59977f75eb 24-Jan-2011 Huahui Wu <hwu@google.com> A few small cleanning-ups.

1. Remove mDeferMultiTouch in WebView, it was for testing only but
we don't need it now since we always pass MultiTouch to WebKit.

2. Remove the use of mDeferMultiTouch in DRT tests.

3. Correct the index of getX(Y) for the second touch point in the
debug string of MotionEvent.

Change-Id: Ib63cfc5935af1a169ed26b2b138f74908492bc18
/frameworks/base/core/java/android/view/MotionEvent.java
cb1404e45639d20439d7700b06d57ca1a1aad1fa 16-Jan-2011 Jeff Brown <jeffbrown@google.com> Add joystick support to framework.

Change-Id: I95374436708752e1a9cff3f85c5b9bc3e0987961
/frameworks/base/core/java/android/view/MotionEvent.java
e838a427786f136155b618962bd18781be8e012d 14-Jan-2011 Huahui Wu <hwu@google.com> b/3133123 Pass touch point ids to WebKit.

This is the CL in framework side and it needs the WebKit part CL:
https://android-git.corp.google.com/g/#change,89627

Change-Id: I11d4ffa29fa106d918332e6983090b06726ebd36
/frameworks/base/core/java/android/view/MotionEvent.java
1f2451007c660091b7b090c1ea332f9044515d2d 19-Nov-2010 Jeff Brown <jeffbrown@google.com> Ensure the ShortcutManager uses the correct key character map.

The ShortcutManager used to only receive the key code of the key event
that triggered the shortcut. This change now provides the shortcut
manager with the whole key event so it can look up the associated
character using the correct key character map.

To make this more efficient, added a mechanism for recycling
key events. At the moment it is only used by key events owned by the
system process, since clients of the existing API (such as Views)
might continue to hold on to key events after dispatch has finished so
they would break if the key event were recycled by the framework.

Deprecated KeyCharacterMap.BUILT_IN_KEYBOARD.

Change-Id: I4313725dd63f2be01c350c005a41c7fde9bc67e8
/frameworks/base/core/java/android/view/MotionEvent.java
497a92cc5ba2176b8a8484b0a7da040eac0e887b 13-Sep-2010 Jeff Brown <jeffbrown@google.com> Add keycodes and meta-key modifiers to support external keyboards.

Added new key maps for external keyboards. These maps are intended to
be shared across devices by inheriting the "keyboards.mk" product
makefile as part of the device's product definition.

One of the trickier changes here was to unwind some code in
MetaKeyKeyListener that assumed that only the low 8 bits of the meta key
state were actually used. The new code abandons bitshifts in favor
of simple conditionals that are probably easier to read anyways.
The special meta key state constants used by MetaKeyKeyListener
are now (@hide) defined in KeyEvent now so as to make it clearer that they
share the same code space even if those codes are not valid for KeyEvents.

The EventHub now takes care of detecting the appropriate key layout
map and key character map when the device is added and sets system
properties accordingly. This avoids having duplicate code in
KeyCharacterMap to probe for the appropriate key character map
although the current probing mechanism has been preserved for legacy
reasons just in case.

Added support for tracking caps lock, num lock and scroll lock and
turning their corresponding LEDs on and off as needed.

The key character map format will need to be updated to correctly support
PC style external keyboard semantics related to modifier keys.
That will come in a later change so caps lock doesn't actually do
anything right now except turn the shiny LEDs on and off...

Added a list of symbolic key names to KeyEvent and improved the toString()
output for debug diagnosis. Having this list in a central place in the
framework also allows us to remove it from Monkey so there is one less
thing to maintain when we add new keycodes.

Bug: 2912307
Change-Id: If8c25e8d50a7c29bbf5d663c94284f5f86de5da4
/frameworks/base/core/java/android/view/MotionEvent.java
dd8b0c90400a1c59d4d71d768c02eed961596bc8 12-Oct-2010 Jeff Brown <jeffbrown@google.com> am 41aabeb5: am 1e6a3a53: Merge "Added more robust tracking and cancelation of events." into gingerbread

Merge commit '41aabeb51305d19747687f246080f44fc2a74435'

* commit '41aabeb51305d19747687f246080f44fc2a74435':
Added more robust tracking and cancelation of events.
b699726018a0049665d8ad6b90dbc5af0e18f135 09-Oct-2010 Jeff Brown <jeffbrown@google.com> Added more robust tracking and cancelation of events.

This change fixes several issues where events would be dropped in the
input dispatch pipeline in such a way that the dispatcher could not
accurately track the state of the input device.

Given more robust tracking, we can now also provide robust cancelation
of input events in cases where an application might otherwise become
out of sync with the event stream due to ANR, app switch, policy decisions,
or forced focus transitions.

Pruned some of the input dispatcher log output.

Moved the responsibility for calling intercept*BeforeQueueing into
the input dispatcher instead of the input reader and added support for
early interception of injected events for events coming from trusted
sources. This enables behaviors like injection of media keys while
the screen is off, haptic feedback of injected virtual keys, so injected
events become more "first class" in a way.

Change-Id: Iec6ff1dd21e5f3c7feb80ea4feb5382bd090dbd9
/frameworks/base/core/java/android/view/MotionEvent.java
20e987bfc35d0ae6cb6344ead65ed44ee7cf8750 23-Aug-2010 Jeff Brown <jeffbrown@google.com> Add MotionEvent Matrix transformations.

Fixed issued in ViewGroup's transformation of MotionEvents to ensure
that the entire historical trace is transformed, not just the current
pointer.

Simplified the code in ViewGroup for splitting events across Views.
The new code also handles the case where some pointers are dispatched
to the ViewGroup in addition to its children whereas the previous
code would drop some pointers on the floor.

Change-Id: I56ac31903e1de8a9c376d9c935b7217b0c42d93e
/frameworks/base/core/java/android/view/MotionEvent.java
dc1ab4b5cc274b7d744c11a939bb5910becec5e0 15-Sep-2010 Jeff Brown <jeffbrown@google.com> Input API review.

Drop currently unsupported input features.
Add documentation comments.

Change-Id: I407d2e1dd90c5ee82983a3ccf177430d35ee7592
/frameworks/base/core/java/android/view/MotionEvent.java
85a3176704b5bfbeece9bd928369fbb76eec7dc6 02-Sep-2010 Jeff Brown <jeffbrown@google.com> Add support for secure views.

Added the MotionEvent.FLAG_WINDOW_IS_OBSCURED flag which is set by the
input manager whenever another visible window is partly or wholly obscured
the target of a touch event so that applications can filter touches
accordingly.

Added a "filterTouchesWhenObscured" attribute to View which can be used to
enable filtering of touches when the view's window is obscured.

Change-Id: I936d9c85013fd2d77fb296a600528d30a29027d2
/frameworks/base/core/java/android/view/MotionEvent.java
2f6d975b93bbc5b55c35a00d913ee38ad9b76401 20-Aug-2010 Jeff Brown <jeffbrown@google.com> Minor MotionEvent optimization.

Change-Id: I862e934e8dae80f394ffd4ab4b4697037805022c
/frameworks/base/core/java/android/view/MotionEvent.java
b0d6ba1ec4f71b96cab7d1ff62b846d5cf162c4f 18-Aug-2010 Gilles Debunne <debunne@google.com> Text selection without trackball.

Backported from HC.

Squashed commit of the following:

commit af214a595c7a9fdd11a2dc384f7d4665abf751c0
Fixes in TextView's selection.

commit eb9fd59ebe6500a66c2003d46b5802299970ae8d
TextView with Selection Contextual Mode

commit 4c4c338ef355b369ce4b57d6c6fba7ee8f9dddf4
Cosmetic changes around TextView.

commit d4b4b054e87480d984ad18766f5e76553e3080d8
Double and one and a half tap removed from TextView.

commit 897c2847ba1fca8ef01eadadd1bc3de007af3ee5
Selection handlers in TextView

commit 832be74a5394649e28927484d9a86c6d53b430e7
New cursor controller in TextViews.

Change-Id: I01cc64736e2abea605317ee53907a1713617fc17
/frameworks/base/core/java/android/view/MotionEvent.java
9e2ad36be87f2703b3d737189944d82f93bd4f27 31-Jul-2010 Jeff Brown <jeffbrown@google.com> Enhanced VelocityTracker for > 5 pointers and fixed bugs.

Improved PointerLocation tool to use VelocityTracker more efficiently
and correctly when multiple pointers are down.

Fixed a bug in TouchInputMapper where it was not correctly copying
the id to index map in the last touch data. This could cause strange
behavior on secondary pointer up events.

Also added finished callback pooling in InputQueue.

Change-Id: Ia85e52ac2fb7350960ea1d7edfbe81a1b3e8267b
/frameworks/base/core/java/android/view/MotionEvent.java
6ec402b5ae33c8927694d8522b4cc6a5c8ba974e 29-Jul-2010 Jeff Brown <jeffbrown@google.com> DO NOT MERGE: Fix input event injection ANRs on UI thread.

Added a new asynchronous injection mode and made the existing
synchronization mechanism more robust.

Change-Id: Ia4aa04fd9b75ea2461a844c5b7933c831c1027e6
/frameworks/base/core/java/android/view/MotionEvent.java
6d0fec2de3601821f4f44eeb7d7deedebb2b7117 24-Jul-2010 Jeff Brown <jeffbrown@google.com> Refactor input reader to support new device types more easily.

Refactored the input reader so that each raw input protocol is handled
by a separate subclass of the new InputMapper type. This way, behaviors
pertaining to keyboard, trackballs, touchscreens, switches and other
devices are clearly distinguished for improved maintainability.

Added partial support for describing capabilities of input devices
(incomplete and untested for now, will be fleshed out in later commits).

Simplified EventHub interface somewhat since InputReader is taking over
more of the work.

Cleaned up some of the interactions between InputManager and
WindowManagerService related to reading input state.

Fixed swiping finger from screen edge into display area.

Added logging of device information to 'dumpsys window'.

Change-Id: I17faffc33e3aec3a0f33f0b37e81a70609378612
/frameworks/base/core/java/android/view/MotionEvent.java
e33348ba54cd68d6936cffd4507037c14d4b10c2 16-Jul-2010 Jeff Brown <jeffbrown@google.com> Fix bug with phantom input windows.

Add dumpsys integration for the native input dispatcher.
Add some InputDevice API stubs.
Add an appendFormat helper method to String8 for printf style
string formatting mainly for debugging purposes.
Use generic ArrayList<WindowState> everywhere in WindowManagerService
to eliminate unnecessary casts all over.

Change-Id: I9d1e3bd90eb7222d10620200477f11b7bfd25e44
/frameworks/base/core/java/android/view/MotionEvent.java
c5ed5910c9ef066cec6a13bbb404ec57b1e92637 15-Jul-2010 Jeff Brown <jeffbrown@google.com> Add support for new input sources.

Added several new coordinate values to MotionEvents to capture
touch major/minor area, tool major/minor area and orientation.

Renamed NDK input constants per convention.

Added InputDevice class in Java which will eventually provide
useful information about available input devices.

Added APIs for manufacturing new MotionEvent objects with multiple
pointers and all necessary coordinate data.

Fixed a bug in the input dispatcher where it could get stuck with
a pointer down forever.

Fixed a bug in the WindowManager where the input window list could
end up containing stale removed windows.

Fixed a bug in the WindowManager where the input channel was being
removed only after the final animation transition had taken place
which caused spurious WINDOW DIED log messages to be printed.

Change-Id: Ie55084da319b20aad29b28a0499b8dd98bb5da68
/frameworks/base/core/java/android/view/MotionEvent.java
5c225b1680e696ae8bbf505a1997d6f720672f74 16-Jun-2010 Jeff Brown <jeffbrown@google.com> Even more native input dispatch work in progress.

Added more tests.
Fixed a regression in Vector.
Fixed bugs in pointer tracking.
Fixed a starvation issue in PollLoop when setting or removing callbacks.
Fixed a couple of policy nits.

Modified the internal representation of MotionEvent to be more
efficient and more consistent.

Added code to skip/cancel virtual key processing when there are multiple
pointers down. This helps to better disambiguate virtual key presses
from stray touches (such as cheek presses).

Change-Id: I2a7d2cce0195afb9125b23378baa94fd2fc6671c
/frameworks/base/core/java/android/view/MotionEvent.java
46b9ac0ae2162309774a7478cd9d4e578747bfc2 23-Apr-2010 Jeff Brown <jeffbrown@google.com> Native input dispatch rewrite work in progress.

The old dispatch mechanism has been left in place and continues to
be used by default for now. To enable native input dispatch,
edit the ENABLE_NATIVE_DISPATCH constant in WindowManagerPolicy.

Includes part of the new input event NDK API. Some details TBD.

To wire up input dispatch, as the ViewRoot adds a window to the
window session it receives an InputChannel object as an output
argument. The InputChannel encapsulates the file descriptors for a
shared memory region and two pipe end-points. The ViewRoot then
provides the InputChannel to the InputQueue. Behind the
scenes, InputQueue simply attaches handlers to the native PollLoop object
that underlies the MessageQueue. This way MessageQueue doesn't need
to know anything about input dispatch per-se, it just exposes (in native
code) a PollLoop that other components can use to monitor file descriptor
state changes.

There can be zero or more targets for any given input event. Each
input target is specified by its input channel and some parameters
including flags, an X/Y coordinate offset, and the dispatch timeout.
An input target can request either synchronous dispatch (for foreground apps)
or asynchronous dispatch (fire-and-forget for wallpapers and "outside"
targets). Currently, finding the appropriate input targets for an event
requires a call back into the WindowManagerServer from native code.
In the future this will be refactored to avoid most of these callbacks
except as required to handle pending focus transitions.

End-to-end event dispatch mostly works!

To do: event injection, rate limiting, ANRs, testing, optimization, etc.

Change-Id: I8c36b2b9e0a2d27392040ecda0f51b636456de25
/frameworks/base/core/java/android/view/MotionEvent.java
d28f4be870ea8850a2d4a2fe51333643f16b9ab1 03-Jun-2010 Jeff Brown <jeffbrown@google.com> Fixed some minor bugs in MotionEvent recycling.

1. MotionEvent.recycle() never set mRecycled to true so it couldn't actually
detect doubly-recycled events (unless the TRACK_RECYCLED_LOCATION debuging
flag was enabled).

2. MotionEvent.obtain() did not set mNext to null before returning the event
so it would unnecessarily retain a reference to other events in the
recycled event linked list until recycled again.

Change-Id: I93709c402d260691875f632dfc080a355f85fbb0
/frameworks/base/core/java/android/view/MotionEvent.java
b125dc5599468a09d82751cd76152071ae485afb 13-Feb-2010 Dianne Hackborn <hackbod@google.com> Fix MotionEvent pointer API.

Ooops. The API said that the pointer down and up actions contained
the pointer id, but it is actually the index. Actually it makes
much more sense for it to be the index, and those ACTION_POINTER_1_DOWN
etc. constants were stupid.
/frameworks/base/core/java/android/view/MotionEvent.java
2397640740e053af7ef4aa742467f723186d5ad7 27-Sep-2009 Dianne Hackborn <hackbod@google.com> Maybe fix issue #2145012: Array bounds exception in touch event processing

Change-Id: I223d9ae29f22f08cb8426ccd8bbadeedd5db3fc3
/frameworks/base/core/java/android/view/MotionEvent.java
8df8b2b405c60cacf7a66c4e2ca078dd3d7ec7bd 18-Aug-2009 Dianne Hackborn <hackbod@google.com> Allow wallpapers to get touch events.
/frameworks/base/core/java/android/view/MotionEvent.java
1e8dfc73fba88766ee3c25ae7b3bb1850319b11d 06-Aug-2009 Dianne Hackborn <hackbod@google.com> Fix crash when MotionEvent is initialized with more than 2 fingers, and bump
its initial size to allow for up to 5 fingers.
/frameworks/base/core/java/android/view/MotionEvent.java
d41ba666d12a24ee4624ea9a009151e6165e3775 06-Aug-2009 Dianne Hackborn <hackbod@google.com> Fix documentation.
/frameworks/base/core/java/android/view/MotionEvent.java
0dd7cb4b4ef86eb7d4e837b1948501da66adeebe 04-Aug-2009 Dianne Hackborn <hackbod@google.com> Finish implementation of multiple pointer support for MotionEvent.

The major things going on here:

- The MotionEvent API is now extended to included "pointer ID" information, for
applications to keep track of individual fingers as they move up and down.
PointerLocation has been updated to take advantage of this.

- The input system now has logic to generate MotionEvents with the new ID
information, synthesizing an identifier as new points are down and trying to
keep pointer ids consistent across events by looking at the distance between
the last and next set of pointers.

- We now support the new multitouch driver protocol, and will use that instead
of the old one if it is available. We do NOT use any finger id information
coming from the driver, but always synthesize pointer ids in user space.
(This is simply because we don't yet have a driver reporting this information
from which to base an implementation on.)

- Increase maximum number of fingers to 10. This code has only been used
with a driver that reports up to 2, so no idea how more will actually work.

- Oh and the input system can now detect and report physical DPAD devices.
/frameworks/base/core/java/android/view/MotionEvent.java
18a081e68441a098fe0a1a6283439913cfb6b0ca 29-Jul-2009 Owen Lin <owenlin@google.com> Fix OOB in arraycopy.
/frameworks/base/core/java/android/view/MotionEvent.java
dac57e4ec94591207eeb660adbe53245dd78e713 27-Jul-2009 Adam Bliss <abliss@google.com> Fix a bug that was causing ArrayIndexOutOfBoutExceptions when obtaining a MotionEvent from an older one that had a number of time samples.
/frameworks/base/core/java/android/view/MotionEvent.java
ddca3ee3e86fbaa05c1528bd72afd955f0fb4ee6 24-Jul-2009 Dianne Hackborn <hackbod@google.com> Add support for power keys, improve behavior of virtual keys.

The platform now knows how to deal with a platform key, which at this
point is "just like end call, but don't end a call."

Also improve the handling of virtual keys, to allow for canceling when
sliding off into the display and providing haptic feedback.

Finally fixes a bug where the raw x and y in motion event were not
always set which caused the status bar to not work.
/frameworks/base/core/java/android/view/MotionEvent.java
9822d2b27330793ea4ba9c3316ef35f402f35fb4 21-Jul-2009 Dianne Hackborn <hackbod@google.com> First stab at poly-finger support.

The MotionEvent API should be fairly solid, but there is still a lot of
work to do in the input device code. In particular, right now we are
really stupid about watching how fingers change -- we just take whatever
the driver reports as down and dump that directly into the motion event.

The big remaning work is to assign pointer IDs so that applications have
help in determine which fingers go up and down, and adding support for
the official multi-touch driver protocol.
/frameworks/base/core/java/android/view/MotionEvent.java
e9dcb803a0a08780054c272df12b7e8b5984b30a 16-Jul-2009 Romain Guy <romainguy@android.com> Fixes merge conflict.
/frameworks/base/core/java/android/view/MotionEvent.java
ecf2b68d834d334de218dc427615b4ca05c0293a 25-Jun-2009 Android (Google) Code Review <android-gerrit@google.com> am 7941e903: Merge change 5091 into donut

Merge commit '7941e903c973af66075bbd4fa4bcadf021a61ccc'

* commit '7941e903c973af66075bbd4fa4bcadf021a61ccc':
* new screen resolution support impl.
64f59342d41849bd365cb43fad7505d5e3daa417 21-Jun-2009 Mitsuru Oshima <oshima@google.com> * new screen resolution support impl.
* use full window for activities, and shift & clip the content
* refactored the compatibility code, and introdcued Translator class to handle cooridnate translations.
* removed a workaround to handle an activity with configChagne=rotation in old implementation.
* I'll fix background issue on rotation in next CL.

* removed unnecessary scaling code in SurfaceView, which I forgot to remove when I changed SurfaceView
not to scale the content.
/frameworks/base/core/java/android/view/MotionEvent.java
9d2b0f4de03ca9bcdab5a3608dea5474c91faf86 15-Jun-2009 The Android Open Source Project <initial-contribution@android.com> merge cafdea61a85c8f5d0646cc9413a09346c637f43f w/ one minor conflict in core/java/android/view/MotionEvent.java
cafdea61a85c8f5d0646cc9413a09346c637f43f 12-Jun-2009 Romain Guy <romainguy@android.com> Fixes #1914574. An NPE could be causes in lists by ViewGroup.dispatchDraw().

ViewGroup was trying to access the AttachInfo without checking whether the
info object is null. The object can be null at varioous times in the lifecycle
of a list.
/frameworks/base/core/java/android/view/MotionEvent.java
53071d6d159f6dfd6fe0328a39bcf967ef308a64 14-May-2009 Michael Chan <mchan@android.com> Added LatencyTimer to ease latency measurements

new file: core/java/android/os/LatencyTimer.java
modified: core/java/android/view/MotionEvent.java
modified: core/java/android/view/ViewRoot.java
modified: services/java/com/android/server/InputDevice.java
modified: services/java/com/android/server/KeyInputQueue.java
modified: services/java/com/android/server/WindowManagerService.java
/frameworks/base/core/java/android/view/MotionEvent.java
d4cc32ca99390ca54762f86d4850ab553a05ccf7 08-May-2009 Mitsuru Oshima <oshima@google.com> don't use modulo
/frameworks/base/core/java/android/view/MotionEvent.java
dffbb4dbceb7e90e91b65d02dfdbd1abd6147b94 30-Apr-2009 Mitsuru Oshima <nobody@android.com> AI 148024: fix NPE when there is no history

Automated import of CL 148024
/frameworks/base/core/java/android/view/MotionEvent.java
8169daed2f7a8731d478b884b1f455c747b88478 29-Apr-2009 Mitsuru Oshima <> AI 147976: Compatibility mode support. Part 2.
* Introduced ApplicationScale (may not be good name. CompatibilityScale? CanvasScale? Pls let me know if you have better idea)
* Changes to RootView / SurfaceView
- Makes the app believe it's running in the supported density/resolution.
- Makes the window manager believe it's running at the right density/resolution.
* Added methods to Rect/Event for scaling up/down.
Known issues:
* certain kind of images (such as nine patch for buttons) seesm to be loaded not by app, thus does not take the scale into account,
which, in turn, is causing layout issue.
* ZoomButton in MapView is rendered in wrong place
* Transparent region on Surface is not correct
* Specifying different densities in one process is not working.
BUG=1770627

Automated import of CL 147976
/frameworks/base/core/java/android/view/MotionEvent.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/view/MotionEvent.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/view/MotionEvent.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/android/view/MotionEvent.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/view/MotionEvent.java