summaryrefslogtreecommitdiffstats
path: root/services/input
Commit message (Collapse)AuthorAgeFilesLines
* Add support for input devices that have vibrators.Jeff Brown2012-04-135-4/+305
| | | | | | | | | | 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
* Notify applications when input devices change.Jeff Brown2012-04-124-101/+139
| | | | | | | | | | | | | | | | | This change allows the InputManager to keep track of what input devices are registered with the system and when they change. It needs to do this so that it can properly clear its cache of input device properties (especially the key map!) when changes occur. Added new API so that applications can register listeners for input device changes. Fixed a minor bug in EventHub where it didn't handle EPOLLHUP properly so it would spam the log about unsupposed epoll events until inotify noticed that the device was gone and removed it. Change-Id: I937d8c601f7185d4299038bce6a2934fe4fdd2b3
* HID usage should take precedence over scan code.Jeff Brown2012-04-121-13/+17
| | | | Change-Id: Ibd8988e3dcc0d64f4019ffe491d9789733f9d243
* Refactor key code mapping.Jeff Brown2012-04-115-215/+311
| | | | | | | | | | | | | | | | | | | Added handling for EV_MSC / MSC_SCAN which typically reports the HID usage associated with a key. This will enable key maps to map keys with HID usages that Linux does not natively recognize. Removed keyCode and flags fields from EventHub RawEvent since they don't necessarily make sense in isolation now that we pay attention to HID usage codes too. Removed the fallback code for mapping keys and axes. In practice, an input device should be self-sufficient. We should not ever need to look at the built-in keyboard's key map. In fact, there usually isn't a built-in keyboard anyhow. This code was originally working around a problem where we weren't loading the key map for touch screens with virtual keys, which has long since been fixed. Change-Id: I0a319bdec44be9514f795526347397e94d53a127
* Request key maps from input manager service.Jeff Brown2012-04-104-63/+113
| | | | | | | | | | | | | | | | | | Instead of each application loading the KeyCharacterMap from the file system, get them from the input manager service as part of the InputDevice object. Refactored InputManager to be a proper singleton instead of having a bunch of static methods. InputManager now maintains a cache of all InputDevice objects that it has loaded. Currently we never invalidate the cache which can cause InputDevice to return stale motion ranges if the device is reconfigured. This will be fixed in a future change. Added a fake InputDevice with ID -1 to represent the virtual keyboard. Change-Id: If7a695839ad0972317a5aab89e9d1e42ace28eb7
* Use new EVIOCSCLOCKID ioctl if supported.Jeff Brown2012-04-091-3/+20
| | | | | Bug: 6292993 Change-Id: I718f167c2cd41298ed54847dbc5de872cd4c7e4a
* Add a unique input device descriptor.Jeff Brown2012-04-065-43/+91
| | | | | | | | | | | | | The purpose of the input device descriptor is to make it possible to associate persistent settings for each input device, such as the keyboard layout. The descriptor is a hash of the information we have about the device, such as its vendor id, product id, unique id, name, or location. Bug: 6110399 Change-Id: Idb80f946819b3f0dbf4e661bb0a753dbc2b60981
* Add Java wrappers for new atrace functionality.Jeff Brown2012-03-092-0/+48
| | | | | | | Instrument a few parts of the input dispatcher and the view hierarchy. Change-Id: I49285c9fb3502253baa1ffed60f521b8c24fccaf
* fix libgui header locationMathias Agopian2012-02-271-3/+1
| | | | Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
* frameworks/base refactoringMathias Agopian2012-02-202-0/+2
| | | | | | create the new libandroidfw from parts of libui and libutils Change-Id: I1584995616fff5d527a2aba63921b682a6194d58
* frameworks/base refactoring.Mathias Agopian2012-02-1711-21/+21
| | | | | | First step. Move libui includes to their new home: androidfw. Change-Id: Ic042b52fdba72f30edc3cc6339bf30b4c1b99662
* Clean up InputChannel file descriptor data type.Jeff Brown2012-02-141-1/+1
| | | | | | File descriptors are ints. Change-Id: Ie36733bf36ddfeaa9a09ef6ebd7bd2f1788f5d27
* Don't serialize motion events.Jeff Brown2012-02-132-15/+31
| | | | | | | | | On reflection, only key events need to be serialized. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I028b4eac97497d012036cb60ffbac4cb22d3966c
* Implement batching of input events on the consumer side.Jeff Brown2012-02-132-18/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To support this feature, the input dispatcher now allows input events to be acknowledged out-of-order. As a result, the consumer can choose to defer handling an input event from one device (because it is building a big batch) while continuing to handle input events from other devices. The InputEventReceiver now sends a notification when a batch is pending. The ViewRoot handles this notification by scheduling a draw on the next sync. When the draw happens, the InputEventReceiver is instructed to consume all pending batched input events, the input event queue is fully processed (as much as possible), and then the ViewRoot performs traversals as usual. With these changes in place, the input dispatch latency is consistently less than one frame as long as the application itself isn't stalled. Input events are delivered to the application as soon as possible and are handled as soon as possible. In practice, it is no longer possible for an application to build up a huge backlog of touch events. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I42c01117eca78f12d66d49a736c1c122346ccd1d
* Optimize dispatcher for back-to-back finished signals.Jeff Brown2012-02-131-8/+20
| | | | | | | | | | | | | Minor tweak to the dispatcher to handle as many finished signals in a receive callback as possible instead of going back to the Looper and waiting for the next poll() to hit the callback again. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I8471107371693e21ce8ce7cca1e8d79ba4ca2351
* Dispatch multiple touch events in parallel.Jeff Brown2012-02-132-156/+184
| | | | | | | | | | | | | | | | | | This change enables the input dispatcher to send multiple touch events to an application without waiting for them to be acknowledged. Essentially this is a variation on the old streaming optimization but it is much more comprehensive. Event dispatch will stall as soon as 0.5sec of unacknowledged events are accumulated or a focused event (such as a key event) needs to be delivered. Streaming input events makes a tremendous difference in application performance. The next step will be to enable batching of input events on the client side once again. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I025df90c06165d719fcca7f63eed322a5cce4a78
* Delete premature optimization.Jeff Brown2012-02-132-8/+6
| | | | | | | | This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I5c182f6e17d468bf3033125b2094b2baa5b94e81
* Delete dead code.Jeff Brown2012-02-132-15/+0
| | | | | | | | This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I9f8b93f6a25ddd872f993366b57bab404c93bede
* Delete latency tracking information in the Connection.Jeff Brown2012-02-132-25/+3
| | | | | | | | | | | | | The information gathered here will no longer be valid once we start dispatching multiple events at a time to the same connection. Moreover, we are more concerned with end-to-end latency, which we can measure with sufficiently high accuracy in other ways. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I49a0c9876b64af56b40e96e0d98c45f325da2a73
* Remove active connection tracking.Jeff Brown2012-02-132-44/+0
| | | | | | | | | | | | The dispatcher no longer needs to track which connections are active except perhaps for diagnostic purposes, so we might as well remove this code. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: Ibadc830b7b792a59b9244d0a6e85f320c4947109
* Simplify input target handling in the dispatcher.Jeff Brown2012-02-132-100/+67
| | | | | | | | | | | | Since we no longer stream events to the application, we don't need to keep the current list of input targets around longer than it takes to begin the dispatch cycle. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I5824b04e564c8a4dec991598292441e46c331905
* Rewrite input transport using sockets.Jeff Brown2012-02-132-57/+25
| | | | | | | | | | | | Since we will not longer be modifying events in place, we don't need to use an ashmem region for input. Simplified the code to instead use a socket of type SOCK_SEQPACKET. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I05909075ed8b61b93900913e44c6db84857340d8
* Remove batching and streaming from the input dispatcher.Jeff Brown2012-02-132-630/+81
| | | | | | | | | | | | Don't worry, these features will be moving to a different part of the pipeline. We're just getting them out of the way for now so we can make deeper changes to how the input dispatcher works. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: If97de923c8165776882eef23f5204cc448dad0fc
* Remove the input dispatcher throttle.Jeff Brown2012-02-072-87/+2
| | | | | | | This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: Iab33594bc5df8aa05232ef64c64e98fc61c5bf52
* Merge "Use O_CLOEXEC when opening input device."Jeff Brown2012-01-311-1/+1
|\
| * Use O_CLOEXEC when opening input device.Jeff Brown2012-01-191-1/+1
| | | | | | | | Change-Id: I931614ef4fe2143c9e124c3239d74a4a2ce3816c
* | Merge "Add basic support for new suspend-block ioctls."Jeff Brown2012-01-311-2/+8
|\ \ | |/
| * Add basic support for new suspend-block ioctls.Jeff Brown2012-01-191-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The new ioctls will enable the system to be more selective about which evdev devices should hold wake-locks when their queue is non-empty. For now, we enable this behavior for all configured input devices, which is more or less the status quo. This change is mainly about ensuring that the system still works correctly when combined with a newer kernel that supports the suspend-block ioctls. We can tweak this behavior later. Change-Id: I8ff69aa5198903f7e2998772a339313df17c0f24
* | Improve watchdog monitor for InputReader and InputDispatcher.Jeff Brown2012-01-274-3/+16
|/ | | | | | | | | Try harder to test for liveness. There are situations where the lock might not be held but the input system is stuck in a callback into the window manager policy that has hung. Bug: 5094994 Change-Id: Iff88655512a5dc8bbb4615be65f4115e975c020b
* Remove no longer needed EventHub usleep() optimization.Jeff Brown2012-01-192-18/+0
| | | | | | | | This optimization is no longer needed now that the kernel evdev driver's poll() implementation only wakes up the poll after the final sync. Change-Id: If237776861df9cfac3086e744d3bbf3484d4c53b
* Fix line wrapping.Jeff Brown2012-01-191-2/+3
| | | | Change-Id: I41199d1145d2435eee046a7e5006dcdce0986821
* Fix a few memory leaks in the input dispatcher.Jeff Brown2012-01-122-6/+27
| | | | | Bug: 5862398 Change-Id: Iae3284a223b8307f541a7987f90f5b28e70b9244
* Rename LOG_ASSERT to ALOG_ASSERT DO NOT MERGESteve Block2012-01-093-31/+31
| | | | | | | See https://android-git.corp.google.com/g/157519 Bug: 5449033 Change-Id: I8ceb2dba1b031a0fd68d15d146960d9ced62bbf3
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-084-35/+35
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-064-40/+40
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
* Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block2012-01-043-32/+32
| | | | | | | See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-034-160/+160
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* am 944c985b: am e0e9fd98: Merge "Fix system hotkey handling." into ics-mr1Jeff Brown2011-12-091-0/+11
|\ | | | | | | | | * commit '944c985b4199e6e029568ea87004c9727e469cc0': Fix system hotkey handling.
| * Fix system hotkey handling.Jeff Brown2011-12-071-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed a problem where the key up for the ALT or META key was not delivered to the task switcher dialog because it was deemed to be inconsistent with the window's observed state. Consequently the dialog would not be dismissed when the key was released. Moved global hotkey handling for META+* shortcuts and ALT/META-TAB into the window manager policy's interceptKeyBeforeDispatching method. This change prevents applications from hijacking these keys. The original idea was that these shortcuts would be handled only if the application did not handle them itself. That way certain applications, such as remote desktop tools, could deliberately override some of these less important system shortcuts. Unfortunately, that does make the behavior inconsistent across applications. What's more, bugs in the onKeyDown handler of applications can cause the shortcuts to not work at all, for no good reason. Perhaps we can add an opt-in feature later to enable specific applications to repurpose these keys when it makes sense. Bug: 5720358 Change-Id: I22bf17606d12dbea6549c60d20763e6608576cf7
* | am 4c0e0dd2: am 3e7497b4: Merge "Eliminate hw.keyboards system properties." ↵Jeff Brown2011-11-154-19/+18
|\ \ | |/ | | | | | | | | | | into ics-mr1 * commit '4c0e0dd29dcce33e7521b11d01d21d9431f3b264': Eliminate hw.keyboards system properties.
| * Eliminate hw.keyboards system properties.Jeff Brown2011-11-154-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | Stop using system properties to publish information about the key character map path. Instead, we can retrieve it on demand by asking the window manager. It was possible to exhaust the supply of system properties when repeatedly adding and removing input devices. Bug: 5532806 Change-Id: Idd361a24ad7db2edc185c8546db7fb05f9c28669
* | Modify getState to prefer AKEY_STATE_DOWN and AKEY_STATE_UP over ↵David Deephanphongs2011-11-151-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | AKEY_STATE_UNKNOWN. For the getState() routines that operate on multiple devices / mappers: Return AKEY_STATE_DOWN (or AKEY_STATE_VIRTUAL) if any of the devices/mappers have the key down. Otherwise, return AKEY_STATE_UP if at least one device/mapper returns AKEY_STATE_UP. Otherwise, return AKEY_STATE_UNKNOWN. Change-Id: I1ef6251d73af916b51f408a41c5e4adf5bdc237a
* | Delete dead code.Jeff Brown2011-11-081-8/+0
| | | | | | | | Change-Id: Ia78e338a363ab82f9c0b45ce324c2a7cfa8d8246
* | Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-262-13/+13
|/ | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
* Improve screenshot chord debouncing.Jeff Brown2011-10-123-8/+29
| | | | | | | | | | | | | | | | | | | Bug: 5011907 Introduce a 150ms delay in handling volume down keys while waiting to see if a power key will follow. Don't trigger the screenshot chord if both volume up and volume down are pressed together. Don't trigger the long-press power menu if volume keys are also pressed. Require the user to press both keys in the chord within the debounce time and continue long-pressing them in order to trigger the screenshot action. Change-Id: I248968d37b73c09d6d08e7f62667c443eba32da0
* eventhub: print debugginf info when removing deviceDima Zavin2011-09-291-0/+3
| | | | | Change-Id: I40bbbd3867e8c7ac7d6fb38e1c72432bb4963316 Signed-off-by: Dima Zavin <dima@android.com>
* Adjust layers for system overlays.Jeff Brown2011-09-081-0/+2
| | | | | | | | | | | Prevent system overlays from showing above the notification bar. Allow secure system overlays to be fullscreen, for the pointer location view. Show the drag layer above the notification bar. Change-Id: Ic8d663792a243cca2cd9952d241d001e0357d551
* Merge "Support composite touch / joystick devices better."Jeff Brown2011-08-315-16/+74
|\
| * Support composite touch / joystick devices better.Jeff Brown2011-08-315-16/+74
| | | | | | | | | | | | | | | | This change enables the joystick input mapper to handle any axes that are not claimed by the touch input mapper, which makes auxiliary controls such as wheels / knobs accessible. Change-Id: I01ee7f342ac91acfcb4ccb6676fd52b3d5bf31a0
* | Merge "Fix input channel leak. Bug: 5156144"Jeff Brown2011-08-317-167/+370
|\ \ | |/