258 Commits

Author SHA1 Message Date
Michael Wright
4361e1f46e Remove assist swipe from TOUCH_NAVIGATION devices
Bug: 9019927
Change-Id: I0a67ee00038b6fba7818f64ba02515767e34fe06
(cherry picked from commit 681a3d710402b80a8375a05172b1fb6f720295be)
2013-05-17 21:30:02 +00:00
Michael Wright
2b08c611c8 Mirror LTRIGGER / RTRIGGER as BRAKE / GAS for compatibility
Bug: 8590913
Change-Id: If2918a67ecdd946ed850acc002ca021e150ec39d
2013-04-24 20:08:40 -07:00
Michael Wright
f710413692 Merge "Stop marking gamepads as keyboards" into jb-mr2-dev 2013-04-10 21:14:27 +00:00
Jeff Brown
4dac901f01 Rewrite touch navigation dpad synthesis.
The new implementation more accurately tracks the velocity
of flings and takes care to avoid obvious discontinuities.
The main goal is for a fling to appear to be a linear
extension of the movement already in progress.  The minimum
fling velocity is set to ensure that flings appear to be
fairly smooth despite being discretized.

Use sequences of repeated key events instead of individual
down/up events to represent continuous motions in one
direction which can be helpful for stopping flings at boundaries
such as when flinging the cursor position within a text view.

Compute the movement thresholds based on the physical
size of the touch pad, if known.  If not known, we assume a
nominal size.

Support stopping flings with a tap just like we do for
normal touch events elsewhere in the framework.

Moved the detection of ASSIST swipes into the InputReader
where it belongs.  These swipes must be detected globally
to ensure consistent behavior across the all applications.

Added a custom protocol in EventHub to enable input device
drivers to override the timestamp of the following events
in a packet.  This change enables input device drivers
that have a better idea of when an input event was actually
generated to pass this information to the input system.
Particularly useful with uinput.

Bug: 8583760
Change-Id: I8ef4e827804786d549cfaa00793a2b9dd0fda465
2013-04-10 03:51:18 -07:00
Ying Wang
d685894212 Add liblog
Bug: 8580410
Change-Id: I746aa8258866508c3a725d0773faf4518096548f
2013-04-09 21:54:12 -07:00
Michael Wright
74c8fb601e Stop marking gamepads as keyboards
Change-Id: I0ba49aa3235b2e0a50405cf6d68632e268fe4183
2013-04-08 20:05:32 -07:00
Michael Wright
c6091c64c9 Pipe through device resolution information
Bug: 8424494
Change-Id: Iafeeee0d5cd29342c1cdc86b9616222aaa5d1b94
2013-04-04 18:10:37 -07:00
Michael Wright
40f8f0d136 Deliver key repeats for artificial dpad events
Bug: 8425219
Change-Id: Ib41b06ed40d43f2e30ce2a647871a76cea80177b
2013-03-26 14:34:14 -07:00
Michael Wright
75ebb37faf Add APP_SWITCH to app switch input dispatching optimization
Change-Id: I8a95fbf311ebd62bcdaaeecfacaea7996ddaec74
2013-03-21 20:45:03 -07:00
Michael Wright
e7a9ae8ba0 Add touch navigation input source
Bug: 8276741
Change-Id: I674b9804bf9ae76d694ae7073b54a7d43474a43c
2013-03-11 17:58:22 -07:00
Michael Wright
c50536b85a Merge "Disable kernel keyrepeat" 2013-02-23 06:33:08 +00:00
Michael Wright
a0a72850c2 Disable kernel keyrepeat
Bug: 6332980
Change-Id: Ife69167285aad24ed3e4fa5b65abf59d8dfa4f0a
2013-02-22 14:46:49 -08:00
Mathias Agopian
76f56dd598 am ceec31b7: Merge changes I5a218ca1,I853a76d9
* commit 'ceec31b7dab6a23e443d5dcbcfac4a23b720cfde':
  Refactoring: Rename SurfaceTextureClient to Surface
  clean-up following Surface split
2013-02-15 14:28:22 -08:00
Mathias Agopian
5280061794 Refactoring: Rename SurfaceTextureClient to Surface
Change-Id: I5a218ca11abeeec05e3a4c3cfc581bcc788814ea
2013-02-15 12:47:40 -08:00
Chris Craik
7c1a49f5f5 Revert "Merge remote-tracking branch 'goog/master-chromium' into 'goog/master'" DO NOT MERGE
This reverts commit 6c0307dd0aefe9a08794b155fc03ee60ebd14f25, reversing
changes made to a2cd828b749c444d55c2c41c7dbb85088ff94b9f.

Conflicts:
	packages/SystemUI/res/values-sv/strings.xml

Change-Id: Ia178efe8b14751583d47b2826bfe3d3d5463dd2e
2013-02-13 10:50:20 -08:00
Derek Sollenberger
fc615a0f64 Remove calls to SkCanvas::setBitmapDevice()
Change-Id: Ib0aa2f65b77802b105c0e8a9d7cdde2e863d3673
2013-01-08 10:00:54 -05:00
Jeff Brown
074b8b7cf1 Eliminate potential reentrance from unregisterInputChannel.
Ensure that all callbacks into the window manager policy occur
on the input dispatcher thread in the right place.  This fixes
a potential deadlock that may occur if the window manager
unregisters an input channel while holding its own lock.

The change is simply to defer running asynchronous commands
(usually callbacks into the policy) until the next iteration
of the dispatch looper thread.

Bug: 7382388
Change-Id: I90095580d717fcddb2209ef332df56400f837a34
2012-10-31 19:01:31 -07:00
Jeff Brown
f33b2b2b24 Recover from bad input event timestamps from the kernel.
This can happen due to a race when the input device is
opened or if the kernel happens to be missing the required
Android patches to set the timestamp correctly.

Bug: 7291243
Change-Id: If4319440eaff2889147c86296abd39efc5664346
2012-10-05 19:33:28 -07:00
Jeff Brown
1e3b98d47d New internal API to eliminate poke locks.
Added a new WindowManager.LayoutParams inputFeatures flag
to disable automatic user activity behavior when an input
event is sent to a window.

Added a new WindowManager.LayoutParams field userActivityTimeout.

Bug: 7165399
Change-Id: I204eafa37ef26aacc2c52a1ba1ecce1eebb0e0d9
2012-10-01 14:27:34 -07:00
Jeff Brown
bcc046af4e Bundle correlated switch changes atomically.
This is a prerequisite for headset jack detection on Manta.

Bug: 6548391
Change-Id: I549a194344511c0cee578b00f6a9ab5fdbdfb99c
2012-09-27 21:42:57 -07:00
Jeff Brown
83d616a9c7 Make input system aware of multiple displays.
The input system needs to know about the window that has
focus, even if it is on a secondary display.  So now we
send it the list of all windows and indicate which display
they are on.  We filter the list of windows as necessary
when delivering touch events.

To keep things simple, monitor input channels and input
filters are not supported except on the main display.
We also do not pass the display id to applications; it is
only used inside the input system for now.

Properly scale touch coordinates based on the viewport.
This will be needed to ensure that touch works on external
display as well as when the internal display is being used
to simulate a different resolution.

Change-Id: I1815579a52fcc852c519b5391fc7ab8767c2dc59
2012-09-10 15:48:47 -07:00
Jeff Brown
d728bf514f Make display manager tell input system about viewports.
The window manager is no longer responsible for telling the
input system about the display viewport.

Change-Id: I932882bae55decef55f25093bb2a7ebac1620bb1
2012-09-08 18:12:57 -07:00
Jeff Brown
4fd42e5a90 Remove unused "layer" argument from show().
Change-Id: I795edb8889bbacdf20fc54d755034040295f281a
2012-08-27 14:34:55 -07:00
Jeff Brown
64a55af0ac Add plumbing for new surface flinger display API.
Cleaned up the implementation of Surface and SurfaceSession
to use more consistent naming and structure.

Added JNI for all of the new surface flinger display API calls.

Enforced the requirement that all Surfaces created by
the window manager be named.

Updated the display manager service to use the new methods.

Change-Id: I2a658f1bfd0437e1c6f9d22df8d4ffcce7284ca2
2012-08-27 14:34:54 -07:00
Jeff Brown
0b722fe9ce Use new surface flinger API.
Change-Id: Ic888577408a59a36481a48010e19c5e77c24e211
2012-08-27 14:34:53 -07:00
Jeff Brown
b696de5c10 Move and rename user activity event type constants.
Change-Id: Ie565808796773b6896e71ddfac6aaaf8031de846
2012-07-27 18:14:56 -07:00
Jeff Brown
037f727f49 Improve handling of size and orientation.
Some touch device drivers report the range of
ABS_MT_ORIENTATION as [0,1].  The Linux multitouch protocol
spec says that the 0 value should always be considered vertical.

Add a new 'box' calibration mode for size to handle the case
where width and height are being provided.  The 'diameter'
calibration mode is inadequate because it drops one of these
components.

Change-Id: I7bd744fdff95acd4044d295efe8bd7186dbe8061
2012-06-25 17:35:13 -07:00
Jeff Brown
22aa512026 Capture input dispatcher's last ANR state in bug report.
Some ANR bugs are very difficult to localize because by the time
the bug report has been captured, the relevant information is
gone.  Work around this by capturing a log of the input dispatcher's
state at the exact time of the ANR before anything has changed
and include this information in the bug report.

Also fixed a nit related to some format strings that had
improper field widths specified.

Bug: 6680398
Change-Id: I5323bf18ec5e47a767cd053209753cc46852bf4c
2012-06-17 15:51:30 -07:00
Jeff Brown
265f1ccc51 Improve ANR diagnostics.
When an ANR occurs, log the associated reason.

When an event takes too long to process (currently more than 2 seconds)
log basic information about the event including how long it actually
took.

Dump the contents of the inbound, outbound and wait queues as part
of dumpsys input.

Bug: 6574842
Change-Id: I9ab754c320f609cb86fe266c469a61e7032dfed6
2012-06-11 18:05:31 -07:00
Jeff Brown
8249fc6183 Don't ANR on hover, scroll or if a window goes away.
Prevents ANR on hover or scroll events.

Prevents ANR in the case where one finger touches a window which
is subsequently removed then a second finger comes along and tries
to touch something.

Change-Id: I985ccb70cd86659992328f14f8a705f3f05ea2e5
2012-05-24 19:34:39 -07:00
JP Abgrall
286298896b Merge "Revert "services: input events: enable debugging in EventHub (touch screen issues)"" into jb-dev 2012-05-16 13:24:10 -07:00
JP Abgrall
25a465bb44 Revert "services: input events: enable debugging in EventHub (touch screen issues)"
This reverts commit df0a89daa8018f9dec53d8d766e5a045347ffc93

Get rid of the debugging for the release.
2012-05-16 10:33:49 -07:00
Jeff Brown
8a90e6e317 Minor refactoring before starting on velocity tracker changes.
Bug: 6413587
Change-Id: I5eba2bb57193bff78cb3740de5f87aca0b31d154
2012-05-11 12:32:56 -07:00
Jeff Brown
571d4cbeec Merge "Fix bugs in fallback key handling." into jb-dev 2012-05-09 17:35:07 -07:00
Jeff Brown
fd23e3ed97 Fix bugs in fallback key handling.
If a fallback key is generated using a key plus a modifier,
then it's possible we might get a different fallback key
generated if the modifier has changed.  PhoneWindowManager
needs to remember which fallback is last generated for a
given key code so that it can apply the same fallback action.

When generating cancellation events, it's important to have
preserved the policyFlags of the original event.  Otherwise
we may not dispatch the cancellation properly.  For example,
some actions are not performed if the POLICY_FLAG_TRUSTED
is not specified.

Remember the metaState associated with a key event so we can
include it when canceled.

Tell the policy when a fallback is being cancelled so that it
can clean up its state.

After a SEARCH shortcut is invoked, clear the flag indicating
that a shortcut is pending.  This is to prevent SEARCH from
getting stuck down in the case where we might forget to send
the up.  (Shouldn't happen anymore after the prior fixes.)

Bug: 5616255
Change-Id: I68f0a9679c7af464eaf31c099f2aa50b53fecf1f
2012-05-09 13:34:28 -07:00
JP Abgrall
956f9bd004 Merge "services: input events: enable debugging in EventHub (touch screen issues)" into jb-dev 2012-05-09 10:41:28 -07:00
JP Abgrall
df0a89daa8 services: input events: enable debugging in EventHub (touch screen issues)
Enable verbose logging, but limit the output of events to only those that
are stale by more than 1ms.
This does not overly pollute the logcat output.


Bug: 6258051
Change-Id: I32012a379ca0e97c0834975482cd91f9eeb08907
2012-05-08 16:38:33 -07:00
Jeff Brown
c042ee2acd Disable input dispatch until boot finished.
Bug: 6263070
Change-Id: I25e15e3d8af8eb3343c7b684fec345337d9f6aab
2012-05-08 13:58:32 -07:00
Jeff Brown
a75fe05b6e Use EVIOCSCLOCKID correctly.
Bug: 6382031
Change-Id: I87b0887ce867a79758bcd24e2202280270faaf8c
2012-05-01 18:41:26 -07:00
Jeff Brown
daa3753a04 Improve handling of built-in keyboard.
The window manager policy made some incorrect assumptions about the
meaning of the Configuration.keyboard field.  We need to be more
careful about distinguishing between built-in and external keyboards.

Most of this change is to move the determination of the parts of
the Configuration related to input devices into the WindowManagerService
leveraging new features of the InputManagerService to good effect.

Then we plumb through the flag that indicates whether a device
is internal or external so that we can be more particular about
how the lid switch effects changes to the Configuration.

Bug: 6424373
Change-Id: I36a1c22ade35e578955465a25940a33f227b9763
2012-05-01 16:34:20 -07:00
Dianne Hackborn
c3742a18a6 am 7086cd5c: am 5600deb7: am d26a8b73: am cda8329e: Merge "Distance max set incorrectly"
* commit '7086cd5c75073b75cd4a7d61aaa9f0529450e4e5':
  Distance max set incorrectly
2012-04-24 16:08:22 -07:00
Andreas Sandblad
8239940d0e Distance max set incorrectly
The distance max used in the MotionRange is calculated
incorrectly.

Looks like a copy-and-paste error.

Change-Id: I2b6daab088df0fb69e05682b67ca33524ff35987
2012-04-23 09:53:30 +02:00
Jeff Brown
5bbd4b4f5f Get alias for Bluetooth devices.
Bluetooth devices can be renamed by the user.  Make the
input system aware of the user-specified name and transparently
pass it down to applications.  This enables the keyboard
layout picker Settings UI to use device names that are
consistent with what the user set in the Bluetooth UI.

Bug: 6363157
Change-Id: I8eea26ce2c69c2a3f09c8de02e9e847610e0419c
2012-04-20 20:11:12 -07:00
Jeff Brown
f44e39493c When ANR happens, only remove ANR'd window.
The system bar uses input event injection to inject BACK keys
into the application.  If the receiving application ANRs, we
used to clear the touch state unconditionally.  Doing so would
prevent the system bar from receiving the ACTION_UP event so
the back button would continue to appear pressed until pressed
again.

Now we are more careful to only remove the specific ANR'd
window from the touch state.  Other windows should continue
to receive touch events as usual.

Change-Id: If86bfc323e2c7aed82ca1334bc67da649953168f
2012-04-20 11:33:27 -07:00
Jeff Brown
00710e906b Make InputDevice.SOURCE_STYLUS meaningful.
Bug: 5424551
Change-Id: I415cb1842422e050cc41b17f5a1f13b4fab17a44
2012-04-19 15:21:08 -07:00
Jeff Brown
61c0824058 Don't load keyboard layout overlay for virtual keyboard.
Bug: 6110399
Change-Id: I07c85cf991790ed8766b097acc39295a8065a5ea
2012-04-19 11:25:09 -07:00
Jeff Brown
426f905b84 Fix build.
Change-Id: I277042c91b34af59e70941fd5b458581310b1c22
2012-04-17 19:52:56 -07:00
Jeff Brown
4a3862f6b0 Add Dvorak keyboard layout.
Added support for mapping both scan codes and HID usages to
KeyLayoutMap and KeyCharacterMap.  Keyboard overlays can
now influence how key events are mapped to key codes.

Bug: 6110399
Change-Id: I6619fd2d3e1337c55928f89869dbc45b535c7ccf
2012-04-17 18:50:05 -07:00
Jeff Brown
6ec6f79e1a Support loading keyboard layout overlays from resources.
Added the concept of a keyboard layout overlay, which is
a key character map file that has "type OVERLAY".

Added support for loading keyboard layout overlays from
resources dynamically.  The layouts are reloaded whenever they
are changed in the Settings application or an application
is installed.  This is somewhat more aggressive than necessary
so we might want to optimize it later.

Before system-ready, the input system uses just the generic
keyboard layouts that are included on the device system image.
After system-ready, it considers the user's selected keyboard
layout overlay and attempts to load it as necessary.  We need to
wait until system-ready before doing this because we need to
be in a state where it is safe to start applications or access
their resources.

Bug: 6110399
Change-Id: Iae0886d3356649b0d2440aa00910a888cedd8323
2012-04-17 17:56:32 -07:00
Jeff Brown
a47425a13c Add support for input devices that have vibrators.
Added a getVibrator() method to InputDevice which returns a Vibrator
associated with that input device.  Its uses the same API as the
system vibrator which makes it easy for applications to be modified
to use one or the other.

Bug: 6334179
Change-Id: Ifc7f13dbcb778670f3f1c07ccc562334e6109d2e
2012-04-13 17:01:15 -07:00